mkdocs-static-i18n: switching languages regularly does not work as expected

Given the config:

# ...

site_url: https://user.github.io/repo
repo_url: https://github.com/user/repo

# ...

nav:
  - Section:
      - index.en.md
      - other-page.en.md

# ...


extra:
  alternate:
    - name: English
      link: ./en/
      lang: en
    - name: Deutsch
      link: ./de/
      lang: de

# ...

plugins:
  # ...
  - i18n:
      default_language: en
      default_language_only: false
      languages:
        en: English
        de: Deutsch
      nav_translations:
        Section: Abschnitt
  # ...

and the structure:

docs
├── index.de.md
├── index.en.md
├── other-page.de.md
└── other-page.en.md

when switching from English (en) to German (de) while on other-page, this plugin messes up the target destination.

Most of the time it correctly takes me to the target destionation: https://user.github.io/repo/de/other-page/, but quite regularly it takes me to:

  • either https://user.github.io/repo/other-page/de/
  • or https://user.github.io/de/other-page/.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (9 by maintainers)

Commits related to this issue

Most upvoted comments

I saw you working on the sitemap recently.

Yes, the sitemap now adds page alternates; which to my knowledge are not taken into account by navigation.instant