major refactor, card pagination beta testing
[kengrimes.com/theme.git] / layouts / _default / single.html
index 080f1a2..44a9d4a 100644 (file)
@@ -1,20 +1,22 @@
 {{- 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 }}">&lt;{{ .Parent.Name }}&gt;</a>
-      {{- if .Page.PrevInSection }}
-      <a href="{{ .Page.PrevInSection.URL }}">Older</a>
+      <a href="{{ .Parent.Permalink }}">&lt;{{ .Parent.Name }}&gt;</a>
+      {{- if .PrevInSection }}
+      <a href="{{ .PrevInSection.Permalink }}">Older</a>
       {{- end }}
     </div>
 {{- end -}}