Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add pages to the navigation? #39

Open
ankush981 opened this issue Dec 18, 2019 · 1 comment
Open

How to add pages to the navigation? #39

ankush981 opened this issue Dec 18, 2019 · 1 comment

Comments

@ankush981
Copy link

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! 😅 I just need this one thing and can then peacefully work on my producing content for my blog. 🙏

@carsonip
Copy link
Owner

carsonip commented Jan 4, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants