mtn/cocoa-eh-hugo-theme

[[menu.main]] not working

Closed this issue · 3 comments

Hi

I'm new to Hugo and in the docs I find this way to add buttons with outside-url to the menu.
So I add

[[menu.main]]
name = "Data"
url = "https://dreamy-stallman-f662b9.netlify.com"

to my config.toml

But nothing happens. But if for example I create a About.md in Content/ folder, then there will be an about button show in the menu.

I find a thread wherein the preobelm was in the theme template. I'm not capable to examine into the theme, so could you check it?

I added the following to header.html in the cocoa-eh theme(./themes/cocoa-eh/layouts/partials/header.html) and it works as I wanted.

But I did not know the reason. And I added the theme as a submodule, could I build site with the modified version of the theme?

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

Ok I could build and deploy with the modified version, just add the above in the header.html works,

mtn commented

Hi @bsun0802, I'm glad you were able to figure that out.

I believe this has come up in the past, and we decided against allowing direct links in the menu bar. I'd like to stick to that decision, though of course you can do whatever you want on your own forks :-)

Cheers 🎈