summaryrefslogtreecommitdiff
path: root/srv/src/api/tpl/post.html
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2022-05-14 16:14:11 -0600
committerBrian Picciano <mediocregopher@gmail.com>2022-05-14 17:02:16 -0600
commit4c04177c05355ddb92d3d31a4c5cfbaa86555a13 (patch)
treed40a4dcb70ef84ba9356751a9bd96fed99f7f5d2 /srv/src/api/tpl/post.html
parentdd354bc323cd3176c9676444f99b33b69d0a2062 (diff)
Move template rendering logic into api package
Diffstat (limited to 'srv/src/api/tpl/post.html')
-rw-r--r--srv/src/api/tpl/post.html48
1 files changed, 48 insertions, 0 deletions
diff --git a/srv/src/api/tpl/post.html b/srv/src/api/tpl/post.html
new file mode 100644
index 0000000..22a5b97
--- /dev/null
+++ b/srv/src/api/tpl/post.html
@@ -0,0 +1,48 @@
+{{ define "body" }}
+
+<header id="post-header">
+ <h1 id="post-headline">
+ {{ .Title }}
+ </h1>
+ <div class="light">
+ {{ .PublishedAt.Format "2006-01-02" }}
+ &nbsp;•&nbsp;
+ {{ if not .LastUpdatedAt.IsZero }}
+ (Updated {{ .LastUpdatedAt.Format "2006-01-02" }})
+ &nbsp;•&nbsp;
+ {{ end }}
+ <em>{{ .Description }}</em>
+ </div>
+</header>
+
+{{ if (or .SeriesPrevious .SeriesNext) }}
+<p class="light"><em>
+ This post is part of a series:<br/>
+ {{ if .SeriesPrevious }}
+ Previously: <a href="{{ .SeriesPrevious.HTTPPath }}">{{ .SeriesPrevious.Title }}</a></br>
+ {{ end }}
+ {{ if .SeriesNext }}
+ Next: <a href="{{ .SeriesNext.HTTPPath }}">{{ .SeriesNext.Title }}</a></br>
+ {{ end }}
+</em></p>
+{{ end }}
+
+<div id="post-content">
+ {{ .Body }}
+</div>
+
+{{ if (or .SeriesPrevious .SeriesNext) }}
+<p class="light"><em>
+ If you liked this post, consider checking out other posts in the series:<br/>
+ {{ if .SeriesPrevious }}
+ Previously: <a href="{{ .SeriesPrevious.HTTPPath }}">{{ .SeriesPrevious.Title }}</a></br>
+ {{ end }}
+ {{ if .SeriesNext }}
+ Next: <a href="{{ .SeriesNext.HTTPPath }}">{{ .SeriesNext.Title }}</a></br>
+ {{ end }}
+</em></p>
+{{ end }}
+
+{{ end }}
+
+{{ template "base.html" . }}