Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Support layouts per site/language #3360
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 (
I have prefixed the language with "_" to avoid (hopefully) any section collisions.
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:
Additionally, this shouldn't really disrupt any pre-existing sites, and be relatively easy to add in I think.