Automatically hide blog link in header if there are no blog posts

This commit is contained in:
gbl08ma
2017-01-17 23:53:54 +00:00
parent 812a1a0178
commit 771a57d6a9

View File

@@ -16,7 +16,9 @@
<a href="{{ .Site.BaseURL }}"><div class="name"><h1>{{ .Site.Title }}</h1></div></a>
<nav>
<ul>
{{ if ne (len (where .Site.RegularPages "Section" "blog")) 0 }}
<a href="{{ .Site.BaseURL }}blog/"><li>Blog</li></a>
{{ end }}
{{ range .Site.Sections }}
{{ range first 1 (where .Pages "Section" "ne" "")}}
{{ if ne .Section "blog"}}