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

Failed to build docs: jinja2.exceptions.UndefinedError: 'None' has no attribute 'get' #459

Open
marek22k opened this issue Dec 28, 2024 · 0 comments

Comments

@marek22k
Copy link

Hello,

I try to build the documentation for offline usage, but get a error:

marek@debian-builder:~/proguard/docs$ pipx inject mkdocs mkdocs-material
  injected package mkdocs-material into venv mkdocs
done! ✨ 🌟 ✨
marek@debian-builder:~/proguard/docs$ git describe 
v7.1.0-beta1-365-gfbcf41f
marek@debian-builder:~/proguard/docs$ mkdocs build
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory: /home/marek/proguard/docs/html
INFO    -  The following pages exist in the docs directory, but are not included in the "nav" configuration:
             - index.md
             - downloads.md
             - results.md
WARNING -  Doc file 'downloads.md' contains a link 'license.md', but the target is not found among documentation files.
WARNING -  Doc file 'downloads.md' contains a link 'releasenotes.md', but the target is not found among documentation files.
WARNING -  Doc file 'manual/FAQ.md' contains a link 'manual/index.md', but the target 'manual/manual/index.md' is not found among documentation
           files.
WARNING -  Doc file 'manual/releasenotes.md' contains a link 'setup/upgrading.md', but the target 'manual/setup/upgrading.md' is not found among
           documentation files.
Traceback (most recent call last):
  File "/home/marek/.local/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/home/marek/.local/pipx/venvs/mkdocs/lib/python3.11/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marek/.local/pipx/venvs/mkdocs/lib/python3.11/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/marek/.local/pipx/venvs/mkdocs/lib/python3.11/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marek/.local/pipx/venvs/mkdocs/lib/python3.11/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marek/.local/pipx/venvs/mkdocs/lib/python3.11/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marek/.local/pipx/venvs/mkdocs/lib/python3.11/site-packages/mkdocs/__main__.py", line 288, in build_command
    build.build(cfg, dirty=not clean)
  File "/home/marek/.local/pipx/venvs/mkdocs/lib/python3.11/site-packages/mkdocs/commands/build.py", line 328, in build
    _build_theme_template(template, env, files, config, nav)
  File "/home/marek/.local/pipx/venvs/mkdocs/lib/python3.11/site-packages/mkdocs/commands/build.py", line 103, in _build_theme_template
    output = _build_template(template_name, template, files, config, nav)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marek/.local/pipx/venvs/mkdocs/lib/python3.11/site-packages/mkdocs/commands/build.py", line 83, in _build_template
    output = template.render(context)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marek/.local/pipx/venvs/mkdocs/lib/python3.11/site-packages/jinja2/environment.py", line 1295, in render
    self.environment.handle_exception()
  File "/home/marek/.local/pipx/venvs/mkdocs/lib/python3.11/site-packages/jinja2/environment.py", line 942, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/home/marek/.local/pipx/venvs/mkdocs/lib/python3.11/site-packages/material/templates/404.html", line 4, in top-level template code
    {% extends "main.html" %}
  File "/home/marek/.local/pipx/venvs/mkdocs/lib/python3.11/site-packages/material/templates/main.html", line 4, in top-level template code
    {% extends "base.html" %}
  File "/home/marek/.local/pipx/venvs/mkdocs/lib/python3.11/site-packages/material/templates/base.html", line 59, in top-level template code
    {% block fonts %}
^^^^^^^^^^^^^^^^^^^^^^
  File "/home/marek/.local/pipx/venvs/mkdocs/lib/python3.11/site-packages/material/templates/base.html", line 61, in block 'fonts'
    {% set text = config.theme.font.get("text", "Roboto") %}
^^^^^^^^^^^^^^^^^^^^^
  File "/home/marek/.local/pipx/venvs/mkdocs/lib/python3.11/site-packages/jinja2/utils.py", line 92, in from_obj
    if hasattr(obj, "jinja_pass_arg"):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
jinja2.exceptions.UndefinedError: 'None' has no attribute 'get'
@marek22k marek22k changed the title Failed to build docs Failed to build docs: jinja2.exceptions.UndefinedError: 'None' has no attribute 'get' Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant