Skip to content
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

Variable "lang" not found in context #963

Closed
fyang93 opened this issue Mar 7, 2020 · 1 comment
Closed

Variable "lang" not found in context #963

fyang93 opened this issue Mar 7, 2020 · 1 comment
Labels
bug done in pr Already done in a PR

Comments

@fyang93
Copy link

fyang93 commented Mar 7, 2020

Bug Report

Variable "lang" is sometimes unavailable.

Environment

ArchLinux

Zola version: 0.10.0

Expected Behavior

First, I have a templates/index.html file where a title block <title>{% block title %}{% endblock title %}</title> is defined in the header.

Another file templates/tags/list.html extends index.html and overwrite the title block with {% block title %}{{ config.extra.tags[lang] }}{% endblock title %}.

Hopefully, the title will be adjusted to the current language.

Current Behavior

Failed to build the site
Error: Failed to render a list of tags page.
Reason: Failed to render 'tags/list.html'
Reason: Variable config.extra.tags[lang] can not be evaluated because: Variable lang not found in context while rendering 'tags/list.html'

Step to reproduce

Please refer to the Expected Behavior part.
And I have the following config in my config.toml file.

[extra.tags]
en="Tags"
zh="标签"
jp="タグ"

If you find it is hard to reproduce I could provide a minimal example later.

@Keats
Copy link
Collaborator

Keats commented Mar 8, 2020

Looks like the taxonomy list template doesn't get lang like it should

@Keats Keats added the bug label Mar 8, 2020
@Keats Keats added the done in pr Already done in a PR label Mar 25, 2020
@Keats Keats closed this as completed in 01597ad May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug done in pr Already done in a PR
Projects
None yet
Development

No branches or pull requests

2 participants