layouts reverted to .NextInSection following hugo patch
[kengrimes.com/theme.git] / layouts / _default / single.html
1 {{- define "main" -}}
2 <small>{{ .Page.Lastmod }}</small>
3 {{- if (gt (len (findRE "<h1" .Content)) 0) }}
4 {{ replaceRE "(<h1.*</h1>)" "</article>\n$1\n<article>" .Content | strings.TrimLeft "\n " | strings.TrimPrefix "</article>" | replaceRE "\n" "\n " | safeHTML }}</article>
5 {{- else -}}
6 <h1>{{ .Page.Title }}</h1>
7 <article>
8 {{ .Content | replaceRE "\n" "\n " | safeHTML }}
9 </article>
10 {{- end }}
11 <div align="center">
12 {{- if .Page.NextInSection }}
13 <a href="{{ .Page.NextInSection.URL }}">Newer</a>
14 {{- end }}
15 <a href="{{ .Parent.URL }}">&lt;{{ .Parent.Name }}&gt;</a>
16 {{- if .Page.PrevInSection }}
17 <a href="{{ .Page.PrevInSection.URL }}">Older</a>
18 {{- end }}
19 </div>
20 {{- end -}}