alex-shpak / hugo-book

Hugo documentation theme as simple as plain book
https://hugo-book-demo.netlify.app
MIT License
3.21k stars 1.16k forks source link

Edit Page (BookEditPath) function not working for multilanguage projects #629

Open Rojax opened 3 weeks ago

Rojax commented 3 weeks ago

The Edit this page button in the footer does not work for multi-language projects. It always points to a single content. Either to .Site.Params.contentDir (if set) or to /content by default.

This can be reproduced using a config such as

defaultContentLanguage: en
defaultContentLanguageInSubdir: true
languages:
  en:
    contentDir: content/en
    disabled: false
    languageCode: en-US
    languageDirection: ltr
    languageName: English
    title: My Book
    weight: 10
  de:
    contentDir: content/de
    disabled: false
    languageCode: de-DE
    languageDirection: ltr
    languageName: Deutsch
    title: My Book
    weight: 20

See also: https://github.com/gohugoio/hugo/issues/11237