UndefinedError: 'dict object' has no attribute 'toggle'
See original GitHub issue- I’ve read the [contribution guidelines][1] and agree with them
I’ve found a bug and checked that …
- … the problem doesn’t occur with the default MkDocs template
- … the problem is not in any of my customizations (CSS, JS, template)
- … the documentation does not mention anything about my problem
- … there are no open or closed issues that are related to my problem
Description
Since the latest release 7.1.0 an error occurred building a site while including the material/partials/header.html
file
Expected behavior
Build should not fail with an error
Actual behavior
File “/venv/lib/python3.9/site-packages/material/main.html”, line 4, in top-level template code {% extends “base.html” %} File “/venv/lib/python3.9/site-packages/material/base.html”, line 118, in top-level template code {% block header %} File “/venv/lib/python3.9/site-packages/material/base.html”, line 119, in block “header” {% include “partials/header.html” %} File “/venv/lib/python3.9/site-packages/material/partials/header.html”, line 36, in top-level template code <label class="md-header__button md-icon" title="{{ option.toggle.name }}" for="__palette_{{ loop.index0 or loop.length }}" hidden> File “/venv/lib/python3.9/site-packages/jinja2/environment.py”, line 471, in getattr return getattr(obj, attribute)
Steps to reproduce the bug
- Update any sample to the latest release 7.1.0
- run mkdocs build
Package versions
- Python: Python 3.9.2
- MkDocs: mkdocs, version 1.1.2
- Material: Version: 7.1.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Thanks @julian-alarcon Exactly what described solved the issue here as well.
old configuration
new configuration
Ok thanks, that syntax was never officially supported. It makes no sense to use the list syntax without defining the toggles. Thus, it’s a configuration error 😊