Updates page header to show menu items if there are no rss

This commit is contained in:
Josh Johnson 2019-08-18 00:33:39 -04:00
parent 2fa06ec88b
commit a8a2b05461
No known key found for this signature in database
GPG key ID: 93E0C66B0988E48B

View file

@ -2,22 +2,29 @@
<nav>
<h1><a href="/">@{{ .Site.Author.handle }}</a>s {{ .Site.Title }}.</h1>
<div class="menu">
{{ if isset .Site.Params "rsssections" }}
{{ $.Scratch.Add "sections" .Site.Params.rsssections }}
<ul>
{{ range .Site.Menus.main }}
<li>
<a href="{{.URL}}">{{ .Name }}</a>
{{ if in ($.Scratch.Get "sections") .Name }}
<a href="{{.URL}}index.xml"><img src="/img/rss.svg" class="rss-icon" /></a>
{{ end }}
</li>
{{ end }}
{{ with .Site.Author.aboutpage }}<li><a href="{{ . }}">About</a></li>{{ end }}
</ul>
{{ end }}
{{ if isset .Site.Params "rsssections" }}
{{ $.Scratch.Add "sections" .Site.Params.rsssections }}
<ul>
{{ range .Site.Menus.main }}
<li>
<a href="{{.URL}}">{{ .Name }}</a>
{{ if in ($.Scratch.Get "sections") .Name }}
<a href="{{.URL}}index.xml"><img src="/img/rss.svg" class="rss-icon" /></a>
{{ end }}
</li>
{{ end }}
{{ with .Site.Author.aboutpage }}<li><a href="{{ . }}">About</a></li>{{ end }}
</ul>
{{ else }}
<ul>
{{ range .Site.Menus.main }}
<li>
<a href="{{.URL}}">{{ .Name }}</a>
</li>
{{ end }}
{{ with .Site.Author.aboutpage }}<li><a href="{{ . }}">About</a></li>{{ end }}
</ul>
{{ end }}
</div>
</nav>
</header>