1
Fork 0

Show recent subposts in navbar

This commit is contained in:
Jake Howard 2017-04-23 11:40:15 +01:00
parent ea3867ac90
commit 21f0de4bf9

View file

@ -3,21 +3,22 @@
<nav id="nav"> <nav id="nav">
<ul> <ul>
{{ range where .Site.Pages.ByTitle "Kind" "section" }} {{ range where .Site.Pages.ByTitle "Kind" "section" }}
{{ $page := . }}
<li> <li>
<a href="{{ $page.Permalink }}"> <a href="{{ .Permalink }}">{{ title .Title }}</a>
{{ $page.Title }} {{ if .Pages }}
</a> <ul>
{{ range first 4 .Pages.ByDate }}
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
<li><a href="{{ .Permalink }}"><i>See more {{ lower .Title }}</i></a></li>
</ul>
{{ end }}
</li> </li>
{{ end }} {{ end }}
{{ range where .Site.Pages.ByTitle "Kind" "page" }} {{ range where .Site.Pages.ByTitle "Kind" "page" }}
{{ $page := . }} {{ if eq .Section "" }}
{{ if eq $page.Section "" }} <li><a href="{{ .Permalink }}">{{ title .Title }}</a></li>
<li>
<a href="{{ $page.Permalink }}">
{{ $page.Title }}
</a>
</li>
{{ end }} {{ end }}
{{ end }} {{ end }}
</ul> </ul>