sbruder / spectral

Port of html5up’s spectral theme to hugo
Other
69 stars 43 forks source link

Add more than one menu item? #29

Closed KimTholstorf closed 1 year ago

KimTholstorf commented 1 year ago

Is it possible to add new entries to the menu-panel?

When adding new entries below the default POSTS, I immediately get an "Failed to reload config: failed to load config: [1;36m"./config.toml:1:1": unmarshal failed: toml: key url is already defined" error.

Screenshot 2023-09-25 at 02 24 46

Am I missing something obvious?

sbruder commented 1 year ago

For this, you would need to add one entry of [[params.menu.main]] for every menu item. Beneath that, you can set url and title. You already did that correctly for the first item, but mixed some things up for the second. So you should only have to add [[params.menu.main]] above the third and the fourth url lines to make it work.

In your case, it could look like this (typing this off your image, so it might contain typos, it would be great, if you could post it as text next time):

[[params.menu.main]]
url = '/'
title = "Til forsiden"

[[params.menu.main]]
url = '/posts/'
title = "Posts"

[[params.menu.main]] # ← this is what you were missing
url = '/posts/kom-igang/'
title = "Kom igang"

[[params.menu.main]] # ← this is what you were missing
url = '/posts/server-liste/'
title = "Server-liste" # subtitle does not exist
KimTholstorf commented 1 year ago

Thank you - i complety missed that. I'm migratinn from another hugp theme where the syntax for the menu-structure diffrent. Thought is was the same across all hugo themes.

Thanks again!