summaryrefslogtreecommitdiff
path: root/srv/src/api/tpl/index.html
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2022-05-14 17:02:30 -0600
committerBrian Picciano <mediocregopher@gmail.com>2022-05-14 17:02:30 -0600
commite41ff2b897be24a894e75b850f1c06652cc034be (patch)
tree816cc87b789dd96b60f212311e161af1bb583e6a /srv/src/api/tpl/index.html
parent4c04177c05355ddb92d3d31a4c5cfbaa86555a13 (diff)
Implement index handler
This involved re-arranging how templates are being parsed, slightly.
Diffstat (limited to 'srv/src/api/tpl/index.html')
-rw-r--r--srv/src/api/tpl/index.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/srv/src/api/tpl/index.html b/srv/src/api/tpl/index.html
new file mode 100644
index 0000000..240df92
--- /dev/null
+++ b/srv/src/api/tpl/index.html
@@ -0,0 +1,20 @@
+{{ define "body" }}
+<ul id="posts-list">
+
+ {{ range .Posts }}
+ <li>
+ <h2>
+ <a href="{{ .HTTPPath }}">{{ .Title }}</a>
+ </h2>
+ <span>{{ .PublishedAt.Format "2006-01-02" }}</span>
+ {{ if not .LastUpdatedAt.IsZero }}
+ <span>(Updated {{ .LastUpdatedAt.Format "2006-01-02" }})</span>
+ {{ end }}
+ <p>{{ .Description }}</p>
+ </li>
+ {{ end }}
+
+</ul>
+{{ end }}
+
+{{ template "base.html" . }}