gethinode / hinode

A clean documentation and blog theme for your Hugo site based on Bootstrap 5
https://gethinode.com
MIT License
146 stars 52 forks source link

[BUG] Sidebar menu does not support multiple languages #995

Closed markdumay closed 4 months ago

markdumay commented 4 months ago

Describe the bug

The sidebar menu uses menu data defined in the site's data folder. Currently, it does not support any language-specific data, limiting its usefulness in multi-language sites.

To reproduce

Steps to reproduce the behavior:

  1. Create a new Hinode site using the template
  2. Add input from the Hinode example site (which contains, en, fr, and nl pages)
  3. Configure a sidebar menu in data/blog.yml with entries for the first three blogs
  4. Observe the link errors such as Cannot find page: /fr/blog/first-post

Expected behavior

Hinode should use a language-specific data file if available, and use a data file without any language extensions as fallback. By convention, the data files should include the language code as extension. For example, the French translation of the blog sidebar would have the path data/blog.fr.yml when using the YAML format.

Host environment

Please complete the following information where applicable.

Hugo environment

Copy the output of hugo env or npm run env here.

hugo v0.127.0+extended darwin/arm64 BuildDate=2024-06-05T10:27:59Z VendorInfo=brew
GOOS="darwin"
GOARCH="arm64"
GOVERSION="go1.22.4"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.3.2"
github.com/sass/dart-sass/protocol="2.7.1"
github.com/sass/dart-sass/compiler="1.77.5"
github.com/sass/dart-sass/implementation="1.77.5"

Additional context

Raised in #991.

vinser commented 4 months ago

I've tested on v0.24.6 my draft 3-lang document site. It's ok with sidebar now. Thank you! I had to use FM slugs to make hugo find pages from docs..yml titles. Maybe using a construction with links would be more appropriate, but I couldn’t get it to parse local links of this kind

- title: User Guide
  link: /docs/guide