halogenica / beautifulhugo

Theme for the Hugo static website generator
Other
1.15k stars 603 forks source link

How to add an "About" section in a multilingual setup? #344

Open juacq97 opened 4 years ago

juacq97 commented 4 years ago

Hi! I have a little multilingual blog, I want to create an "about" menu, one in english and one on spanish. I added this:

    [languages.es.menu]
      [[languages.es.menu.main]]
        name = "Acerca"
        url = "/es/page/acerca"

    [languages.en.menu]
      [[languages.en.menu.main]]
        name = "About"
        url = "en/page/about"

and then created content/es/page/acerca.org and content/es/page/about.org but when I try the server and click on the about link I get "error 404". How I can add menus (about section)? thanks!

whatacold commented 3 years ago

Hi,

I think this should work, i.e. without the language prefix, thought I haven't test it myself:

    [languages.es.menu]
      [[languages.es.menu.main]]
        name = "Acerca"
        url = "page/acerca"

    [languages.en.menu]
      [[languages.en.menu.main]]
        name = "About"
        url = "page/about"

I have a similar setup at https://whatacold.io/, hope this helps!