Make main menu optional. (#1)
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.
This commit is contained in:
parent
289c9e0b07
commit
0485ff61a4
|
@ -3,12 +3,14 @@
|
||||||
<a class="navigation-title" href="{{ "/" | absURL }}">
|
<a class="navigation-title" href="{{ "/" | absURL }}">
|
||||||
{{ .Site.Title }}
|
{{ .Site.Title }}
|
||||||
</a>
|
</a>
|
||||||
|
{{with .Site.Menus.main}}
|
||||||
<ul class="navigation-list float-right">
|
<ul class="navigation-list float-right">
|
||||||
{{ range sort .Site.Menus.main }}
|
{{ range sort . }}
|
||||||
<li class="navigation-item">
|
<li class="navigation-item">
|
||||||
<a class="navigation-link" href="{{ .URL }}">{{ .Name }}</a>
|
<a class="navigation-link" href="{{ .URL }}">{{ .Name }}</a>
|
||||||
</li>
|
</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
|
{{end}}
|
||||||
</section>
|
</section>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
Loading…
Reference in New Issue