mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
Building the site fails if the menu is not defined in the config, because the `header.html` references `.Site.Menus.main`. It can be made optional by using the `with` helper.
17 lines
421 B
HTML
17 lines
421 B
HTML
<nav class="navigation">
|
|
<section class="container">
|
|
<a class="navigation-title" href="{{ "/" | absURL }}">
|
|
{{ .Site.Title }}
|
|
</a>
|
|
{{with .Site.Menus.main}}
|
|
<ul class="navigation-list float-right">
|
|
{{ range sort . }}
|
|
<li class="navigation-item">
|
|
<a class="navigation-link" href="{{ .URL }}">{{ .Name }}</a>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
{{end}}
|
|
</section>
|
|
</nav>
|