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