initial
[kengrimes.com/theme.git] / layouts / _default / list.html
1 {{- define "main" -}}
2 {{ $paginator := .Paginate (where .Data.Pages.ByDate "Section" .Section) 5 }}
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 {{ .Content }}
7 {{- end -}}
8 {{ range $paginator.Pages }}
9 <h1>{{.Title}}</h1>
10 <article>
11 <p>
12 {{ .Summary | replaceRE "\n" "\n " | safeHTML }}
13 </p>
14 {{- if .Truncated }}
15 <div align="right"><a href="{{ .RelPermalink }}">Continue...</a>&nbsp;</div>
16 {{- end }}
17 </article>
18 {{- end }}
19 {{ template "_internal/pagination.html" . -}}
20 {{- end -}}