When using Material MkDocs theme in combination with both the mkdocs-section-index and mkdocs-static-i18n plugins during running the server using mkdocs serve, Material MkDocs theme crashes and displays an error message.
Steps to Reproduce
Install Material MkDocs theme, mkdocs-section-index plugin, and mkdocs-static-i18n plugin via pip. Here is a list of currently installed pacages:
Start the development server by running mkdocs serve
Observe the error message displayed in the terminal
Crash log
```log
INFO - Building en documentation
Traceback (most recent call last):
File "/Users/ahm/Documents/github/mkdocs-test/venv/bin/mkdocs", line 8, in
sys.exit(cli())
^^^^^
File "/Users/ahm/Documents/github/mkdocs-test/venv/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahm/Documents/github/mkdocs-test/venv/lib/python3.11/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/ahm/Documents/github/mkdocs-test/venv/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahm/Documents/github/mkdocs-test/venv/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahm/Documents/github/mkdocs-test/venv/lib/python3.11/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahm/Documents/github/mkdocs-test/venv/lib/python3.11/site-packages/mkdocs/__main__.py", line 234, in serve_command
serve.serve(dev_addr=dev_addr, livereload=livereload, watch=watch, **kwargs)
File "/Users/ahm/Documents/github/mkdocs-test/venv/lib/python3.11/site-packages/mkdocs/commands/serve.py", line 116, in serve
server.serve()
File "/Users/ahm/Documents/github/mkdocs-test/venv/lib/python3.11/site-packages/mkdocs/livereload/__init__.py", line 162, in serve
self._build_loop()
File "/Users/ahm/Documents/github/mkdocs-test/venv/lib/python3.11/site-packages/mkdocs/livereload/__init__.py", line 184, in _build_loop
func()
File "/Users/ahm/Documents/github/mkdocs-test/venv/lib/python3.11/site-packages/mkdocs/commands/serve.py", line 76, in builder
build(config, live_server=live_server, dirty=dirty)
File "/Users/ahm/Documents/github/mkdocs-test/venv/lib/python3.11/site-packages/mkdocs/commands/build.py", line 332, in build
config.plugins.run_event('post_build', config=config)
File "/Users/ahm/Documents/github/mkdocs-test/venv/lib/python3.11/site-packages/mkdocs/plugins.py", line 522, in run_event
result = method(**kwargs)
^^^^^^^^^^^^^^^^
File "/Users/ahm/Documents/github/mkdocs-test/venv/lib/python3.11/site-packages/mkdocs_static_i18n/plugin.py", line 604, in on_post_build
files.add_files_from_theme(env, config)
File "/Users/ahm/Documents/github/mkdocs-test/venv/lib/python3.11/site-packages/mkdocs/structure/files.py", line 122, in add_files_from_theme
for path in env.list_templates(filter_func=filter):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahm/Documents/github/mkdocs-test/venv/lib/python3.11/site-packages/jinja2/environment.py", line 914, in list_templates
names = self.loader.list_templates()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ahm/Documents/github/mkdocs-test/venv/lib/python3.11/site-packages/jinja2/loaders.py", line 105, in list_templates
raise TypeError("this loader cannot iterate over all templates")
TypeError: this loader cannot iterate over all templates
```
Expected Results
The MkDocs site should load successfully, and the mkdocs-section-index and mkdocs-static-i18n plugins should function as expected.
Actual Results
The Material MkDocs theme crashes and displays an error message.
Description
When using Material MkDocs theme in combination with both the
mkdocs-section-index
andmkdocs-static-i18n
plugins during running the server usingmkdocs serve
, Material MkDocs theme crashes and displays an error message.Steps to Reproduce
mkdocs-section-index
plugin, andmkdocs-static-i18n
plugin viapip
. Here is a list of currently installed pacages:mkdocs.yml
``` site_name: My Docs nav: - Main: index.md - Second: second.md - Third: - /third/index.md - Sub1: third/sub1.md - Sub2: third/sub2.md - Forth: forth.md extra: alternate: - name: English link: en/ lang: en - name: Français link: fr/ lang: fr theme: name: material palette: scheme: slate features: - navigation.tabs - navigation.tabs.sticky markdown_extensions: - attr_list - toc: permalink: ⚓︎ slugify: !!python/object/apply:pymdownx.slugs.slugify kwds: case: none plugins: - search - ezlinks - section-index - i18n: default_language: en docs_structure: folder languages: en: name: English fr: name: Français nav_translations: en: fr: ```The scaffold of the site structure
``` . ├── docs │ ├── en │ │ ├── forth.md │ │ ├── index.md │ │ ├── second.md │ │ └── third │ │ ├── index.md │ │ ├── sub1.md │ │ └── sub2.md │ └── fr │ ├── forth.md │ ├── index.md │ ├── second.md │ └── third │ ├── index.md │ ├── sub1.md │ └── sub2.md └── mkdocs.yml 6 directories, 13 files ```mkdocs serve
Crash log
```log INFO - Building en documentation Traceback (most recent call last): File "/Users/ahm/Documents/github/mkdocs-test/venv/bin/mkdocs", line 8, inExpected Results
The MkDocs site should load successfully, and the
mkdocs-section-index
andmkdocs-static-i18n
plugins should function as expected.Actual Results
The Material MkDocs theme crashes and displays an error message.