This idea springs out of my work in #13679.
We have template func that kind of does this for languages, but it's hard to use beyond the simplest of use cases.
With the addition of roles and version as new dimensions to the Hugo build matrix, I though we could end up with something ala this front matter:
title: My Post
languages: ["sv", "no"]
languageDelegees: ["*", "! jp"]
versions: ["v2.0.0"]
versionDelegees: ["v2*"]
Etc.
In the above:
languages: ["sv", "no"] means that this will be rendered for both sv, no, you will get one page in each language, two URLs.
- languageDelegees: ["*", "! jp"] means that we pick the first1 matching delegee page. This means that for e.g.
site.RegularPages you may get a pointer to a Page in another site.
It would obviously be useful if we could set these values (e.g. both versions and versionDelegees) in the cascade configuration, but that will be limited to the configuration file (e.g. hugo.toml), as we need these values early.
This idea springs out of my work in #13679.
We have template func that kind of does this for languages, but it's hard to use beyond the simplest of use cases.
With the addition of
rolesandversionas new dimensions to the Hugo build matrix, I though we could end up with something ala this front matter:Etc.
In the above:
languages: ["sv", "no"]means that this will be rendered for bothsv,no, you will get one page in each language, two URLs.site.RegularPagesyou may get a pointer to aPagein another site.It would obviously be useful if we could set these values (e.g. both
versionsandversionDelegees) in thecascadeconfiguration, but that will be limited to the configuration file (e.g.hugo.toml), as we need these values early.Footnotes
Closes match in the sort order of the {languages,versions,roles} with a preference to matches above (e.g. a newer version). ↩