{{- define "main" -}}
-<small>{{ .Page.Lastmod.Local }}</small>
{{- if (gt (len (findRE "<h1" .Content)) 0) }}
-{{ replaceRE "(<h1.*</h1>)" "</article>\n$1\n<article>" .Content | strings.TrimLeft "\n " | strings.TrimPrefix "</article>" | replaceRE "\n" "\n " | safeHTML }}</article>
+ <article>
+ {{ replaceRE "(<h1.*</h1>)" "</article>\n$1\n<article>" .Content | strings.TrimLeft "\n " | replaceRE "\n" "\n " | safeHTML }}
{{- else -}}
- <h1>{{ .Page.Title }}</h1>
- <article>
- {{ .Content | replaceRE "\n" "\n " | safeHTML }}
- </article>
+ <article>
+ {{ .Content | replaceRE "\n" "\n " | safeHTML }}
{{- end }}
+ </article>
+ {{ if .Params.categories }}[{{ range .Params.categories }} <a href="/categories/{{ . }}">@{{ . }}</a> {{ end }}]{{ end }}
+ {{ if .Params.tags }}[{{ range .Params.tags }} <a href="/tags/{{ . }}">#{{ . }}</a> {{ end}}]{{ end }}
+ <div class="last-modified">Last modified {{ dateFormat "January 2 2006 15:04 MST" .Lastmod }}</div>
<div class="page-nav" align="center">
- {{- if .Page.NextInSection }}
- <a href="{{ .Page.NextInSection.URL }}">Newer</a>
+ {{- if .NextInSection }}
+ <a href="{{ .NextInSection.Permalink }}">Newer</a>
{{- end }}
- <a href="{{ .Parent.URL }}"><{{ .Parent.Name }}></a>
- {{- if .Page.PrevInSection }}
- <a href="{{ .Page.PrevInSection.URL }}">Older</a>
+ <a href="{{ .Parent.Permalink }}"><{{ .Parent.Name }}></a>
+ {{- if .PrevInSection }}
+ <a href="{{ .PrevInSection.Permalink }}">Older</a>
{{- end }}
</div>
{{- end -}}