-
Notifications
You must be signed in to change notification settings - Fork 945
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
404 page doesn't get lang
variable
#1281
Comments
I think passing |
Thanks, @Keats. Sounds good. I'm using this for now, on top of the
Btw, I just realized we have this in the docs: https://www.getzola.org/documentation/templates/overview/
Meaning, we should either add 404 to the list of exceptions here, or make sure 404 also gets all these variables, including |
Hmm I need to think about it, i'm leaning toward setting lang == default_language |
Feature Request
Environment
Zola version: zola 0.12.2
Expected Behavior
Would be great to have
config.default_language
passed to the404.html
template aslang
variable, so that the 404 page can re-use the language-enabled base template without too much extra work.The rational for setting the value as such would be that, in the absence of actual content info, the site would fall back to the "default language".
Additionally, later, we could have the
lang
variable to be set for 404 pages depending on the language-specific part of the URL. For example, if a site has bothen
andhi
enabled, then 404 pages for urls starting with/en/
would get langen
, while those for urls starting with/hi/
gettinghi
as thelang
.Current Behavior
Step to reproduce
On
templates/404.html
:On
templates/base.html
:Alternate Solutions
An alternate solution would be to "set" the value of
lang
variable on theextends
call, like:However, I believe Tera doesn't support that at the moment.
I you think this would be a better solution, we can file an issue on https://github.com/Keats/tera .
Wdyt?
The text was updated successfully, but these errors were encountered: