Playground for https://github.com/ultrabug/mkdocs-static-i18n/issues/297

Repo: https://github.com/tombreit/mkdocs-i18n-test

Zweite Seite

Navigation

Languages Pages

Template context variables

Ref: https://github.com/ultrabug/mkdocs-static-i18n/blob/main/mkdocs_static_i18n/plugin.py#L135
i18n_build_languages: ['en', 'de']
i18n_current_language_config: {'build': True, 'copyright': None, 'default': False, 'extra': None, 'fixed_link': None, 'link': '/de/', 'locale': 'de', 'name': 'Deutsch', 'nav': None, 'nav_translations': None, 'admonition_translations': None, 'site_author': None, 'site_description': None, 'site_name': None, 'site_url': None, 'theme': None}
i18n_current_language: de
i18n_alternates: 

Page context variables

Ref: https://github.com/ultrabug/mkdocs-static-i18n/blob/main/mkdocs_static_i18n/plugin.py#L175
i18n_config: {'build_only_locale': None, 'docs_structure': 'suffix', 'fallback_to_default': False, 'reconfigure_material': True, 'reconfigure_search': True, 'languages': [{'build': True, 'copyright': None, 'default': True, 'extra': None, 'fixed_link': None, 'link': '/', 'locale': 'en', 'name': 'English', 'nav': None, 'nav_translations': None, 'admonition_translations': None, 'site_author': None, 'site_description': None, 'site_name': None, 'site_url': None, 'theme': None}, {'build': True, 'copyright': None, 'default': False, 'extra': None, 'fixed_link': None, 'link': '/de/', 'locale': 'de', 'name': 'Deutsch', 'nav': None, 'nav_translations': None, 'admonition_translations': None, 'site_author': None, 'site_description': None, 'site_name': None, 'site_url': None, 'theme': None}]}
i18n_file_locale: de
i18n_page_locale: de

all_languages

config.plugins["i18n"].all_languages: ['en', 'de']

build_languages

i18n_page_locale: de

- build_languages lang: en
- build_languages lang: de

i18n_files_per_language

Code
{%- for locale, i18n_files in config.plugins["i18n"].i18n_files_per_language.items() %}
- locale:     {{ locale }}
  i18n_files: {{ i18n_files }}
{% endfor %}
Output
- locale:     en
  i18n_files: [File(src_uri='enonly.en.md', dest_uri='enonly/index.html', name='enonly', url='enonly/'), File(src_uri='index.en.md', dest_uri='index.html', name='index', url='./'), File(src_uri='second_page.en.md', dest_uri='second_page/index.html', name='second_page', url='second_page/')]

- locale:     de
  i18n_files: [File(src_uri='deonly.de.md', dest_uri='de/deonly/index.html', name='deonly', url='de/deonly/'), File(src_uri='index.de.md', dest_uri='de/index.html', name='index', url='de/'), File(src_uri='second_page.de.md', dest_uri='de/second_page/index.html', name='second_page', url='de/second_page/')]


Page content:

Zweite Seite

Zweite Seite auf Deutsch.