Skip to content

Instantly share code, notes, and snippets.

@lhstraathof
Created September 23, 2017 18:17
Show Gist options
  • Save lhstraathof/d91a8cf72be8b8ad71b4c2ee6aad8c9e to your computer and use it in GitHub Desktop.
Save lhstraathof/d91a8cf72be8b8ad71b4c2ee6aad8c9e to your computer and use it in GitHub Desktop.
html for a basic menu in hugo template
{{ with .Site.Menus.main }}
<nav class="menu">
<ul class="main_menu">
{{ range . }}
<li class="main_menu__li"><a class="main_menu__link" href="{{ .URL | absURL }}">{{ .Name }}</a></li>
{{ end }}
</ul>
</nav>
{{ end }}
------------------ add this to config.toml
# Menu links that appear on the left sidebar
[[menu.main]]
name = "Home"
url = "/"
weight = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment