mirror of
https://github.com/Noettore/cocoa-eh-hugo-theme.git
synced 2025-10-14 19:26:40 +02:00
Add option to exclude any headings from navbar
This implementation is somewhat messy, but I think the resulting default is sane and it allows customizability. The motivation was it felt weird to me to be linking to a blog, when the home link right above linked to a slighly different version of the same page.
This commit is contained in:
@@ -20,18 +20,18 @@
|
||||
<a href="{{ .Site.BaseURL }}"><div class="name"><h1>{{ .Site.Title }}</h1></div></a>
|
||||
<nav>
|
||||
<ul>
|
||||
{{ if ne (len (where .Site.RegularPages "Section" "blog")) 0 }}
|
||||
<li><a href="{{ .Site.BaseURL }}blog/">Blog</a></li>
|
||||
{{ if (and (ne (len (where .Site.RegularPages "Section" "blog")) 0) (not (in .Site.Params.exclude_headings "blog"))) }}
|
||||
<li><a href="{{ .Site.BaseURL }}blog/">Blog</a></li>
|
||||
{{ end }}
|
||||
{{ range $.Site.Home.Sections }}
|
||||
{{ range first 1 (where .Pages "Section" "ne" "")}}
|
||||
{{ if ne .Section "blog"}}
|
||||
{{ if (and (ne .Section "blog") (not (in .Site.Params.exclude_headings (lower .Section))))}}
|
||||
<li><a href="{{ .Section | urlize | absURL }}">{{ .Section }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ range where .Site.RegularPages "Section" ""}}
|
||||
{{ if and (ne .Title "License") (ne .Title "Home")}}
|
||||
{{ if (and (and (ne .Title "License") (ne .Title "Home")) (not (in .Site.Params.exclude_headings (lower .Title))))}}
|
||||
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
Reference in New Issue
Block a user