panr / hugo-theme-terminal

A simple, retro theme for Hugo
MIT License
1.96k stars 737 forks source link

How do I manage menu location? #458

Closed czernobogBlog closed 2 weeks ago

czernobogBlog commented 1 year ago

Hi, I want to manage the location of menu in the theme. Only after adding two menu the third menu goes in to "Show more" I don't want this. I want the third menu beside the rest of the menu instead of it going to "Show More"

Screenshot from 2023-04-25 10-58-35

Here's my menu config, kindly let me know what changes I will have to do

  [languages.en.menu]
      [[languages.en.menu.main]]
        identifier = "about"
        name = "About"
        url = "/about"
      [[languages.en.menu.main]]
        identifier = "RSS"
        name = "RSS"
        url = "https://my-website/index.xml"
      [[languages.en.menu.main]]
        identifier = "donate"
        name = "Donate"
        url = "/donate"
pastelorange commented 1 year ago

In config.toml set:

[params]
  # if you set this to 0, only submenu trigger will be visible
  showMenuItems = 3
czernobogBlog commented 1 year ago

Thank you! If you don't mind answering then I have one more question; How do I manage arragement of each menu? I.e. Which menu should come first, second, third... and so on.

pastelorange commented 1 year ago

Now that you mention it, this isn't anywhere on the README. Here's how to set a weight on each menu:

  [languages.en.menu]
      [[languages.en.menu.main]]
        identifier = "about"
        name = "About"
        url = "/about"
        weight = 10 # first place
      [[languages.en.menu.main]]
        identifier = "RSS"
        name = "RSS"
        url = "https://my-website/index.xml"
        weight = 20
      [[languages.en.menu.main]]
        identifier = "donate"
        name = "Donate"
        url = "/donate"
        weight = 30 # last place

I'm glad I could be of help :smile:. This is my first time helping in a GitHub issue.