hugo-theme-minos icon indicating copy to clipboard operation
hugo-theme-minos copied to clipboard

How to add pages to the navigation?

Open ankush981 opened this issue 5 years ago • 1 comments

Hello, I was wondering how one would go about adding pages links to the navigation bar. I mean, in the typical blog fashion where you have a series of posts but also individual pages like About Me, etc. I tried to do this by placing two files, one in content/about.md and one in content/posts/my-first-post.md and I expected the About page to show up as a separate link but it doesn't:

new-page-becomes-blog

As you can see, the About page also became one of the blog posts.

Please don't say "Go read the Hugo docs" as I've struggled a lot already! :sweat_smile: I just need this one thing and can then peacefully work on my producing content for my blog. :pray:

ankush981 avatar Dec 18 '19 19:12 ankush981

Hi @ankush981, sorry for the late reply. To add things to the navigation bar (aka menu), see https://gohugo.io/content-management/menus/#add-non-content-entries-to-a-menu It is as easy as doing this in config.toml:

[menu]

  [[menu.main]]
    identifier = "about"
    name = "about hugo"
    pre = "<i class='fa fa-heart'></i>"
    url = "/about/"
    weight = -110

Alternatively you may do this in your post:

menu: "main"

Either way your post will show up in the navigation bar.

If you don't like your post showing up in the list, use this in the post:

hidden: true

carsonip avatar Jan 04 '20 10:01 carsonip