Adding content files as pages in theme(hyde)

Hi!

First i want to say i just joined the Hugo community, im very excited to start out.

I’ve followed the quick start guide and read some posts on this forum, I am however pretty new to static website generators in general, so I have a question :blush:

My current content folder is not big:

content
├── about.md
└── welcome.md

I would like to add these files to the website as individual pages/links under the existing Home link in the sidebar, when using the hyde theme.

I went and checked the file “themes/hyde/layouts/partials/sidebar.html” and I see the following line “a href=”{{.URL}}"> {{ .Name }} " Which i recon is for “Home”

Now, what would i have to write where “.Name” is located to make it list one of the content files like about or welcome?

Im sorry if this post is beyond stupid. Thanks for the help in advance!

Hi @xrefor,

“Home” itself is just a simple link in the template: <li><a href="/">Home</a> </li>. However, Hyde uses Hugo’s menu feature.

You can add content pages by simply adding menu="main" in the frontmatter of each file that you want to link. main is the name of the menu that is used in the sidebar.

If we take another look in the sidebar.html partial you can see that the template is ranging over this menu:

{{ range .Site.Menus.main }}
    <li><a href="{{.URL}}"> {{ .Name }} </a></li>
{{end}}

.Name is just the title of the page that you’re linking. I hope this clarified the use of menus.

Thank you for helping me understand this! So much easier than i thought :smiley: