You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My question: it seems the metadata context variable is not passed to the custom pages.
When I try to render my templates/pages/about.html:
{%extends"default:index.html"%}{%blockcontent%}
About page.
{{super()}}
{%endblock%}
I get:
{% block title %}{{ metadata.title or "Datasette" }}: {% for database in databases %}{{ database.name }}{% if not loop.last %}, {% endif %}{% endfor %}{% endblock %}
File "/home/user/.local/share/pipx/venvs/datasette/lib/python3.9/site-packages/jinja2/environment.py", line 485, in getattr
return getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'metadata' is undefined
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello @simonw,
First of, thanks for Datasette.
My question: it seems the
metadata
context variable is not passed to the custom pages.When I try to render my
templates/pages/about.html
:I get:
I am running datasette as:
and
datasette.yaml
has just my css:When I looked at the code,
metadata
was not among the template variables (slug
was there as mentioned by the doc).Am I missing some setting? Thanks!
My datasette is version
0.64.6
.Beta Was this translation helpful? Give feedback.
All reactions