-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support layouts per site/language #3360
Comments
I've been wishing for exactly this as I've been reworking my site into Hugo. It'd be especially helpful for laying pages out according to different typographic conventions (I'm doing English/Japanese, and CVs are very different across the two). I thought though, that the simpler way might be to use something like:
Using
Additionally, this shouldn't really disrupt any pre-existing sites, and be relatively easy to add in I think. |
@ngsctt I agree, that is much simpler than what I suggested. |
This applies to both regular templates and shortcodes. So, if the site language is French and the output format is AMP, this is the (start) of the lookup order for the home page: 1. index.fr.amp.html 2. index.amp.html 3. index.fr.html 4. index.html 5. ... Fixes gohugoio#3360
This applies to both regular templates and shortcodes. So, if the site language is French and the output format is AMP, this is the (start) of the lookup order for the home page: 1. index.fr.amp.html 2. index.amp.html 3. index.fr.html 4. index.html 5. ... Fixes #3360
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
See http://stackoverflow.com/questions/43149074/jekyll-or-hugo-theme-with-multilanguage-support
Hugo has already a good story for multiple languages, but it could fairly easily be made even more powerful by allowing template overrides per site/language.
Doing large portions of localisation via i18n files can be cumbersome, so to be able to create language-specific layout files/partials/shortcodes would be great.
A simple sample would be:
In the imaginary site above we have a base template set that is used for all sites/languages, but then we override some of the templates for the French language (
fr
). This would also work for themes.I have prefixed the language with "_" to avoid (hopefully) any section collisions.
The text was updated successfully, but these errors were encountered: