summaryrefslogtreecommitdiff
path: root/srv/src/api/tpl
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2022-05-14 21:30:18 -0600
committerBrian Picciano <mediocregopher@gmail.com>2022-05-14 21:35:53 -0600
commit788aba3d0d0bc98c0164f87cf3a4941cf4587a54 (patch)
tree789ea80de8041352a5e2ecda01334b1bbfc3ddbc /srv/src/api/tpl
parentaf08122a253916c9f7d923b6a0197db1cbbf536e (diff)
Fix new index page
Diffstat (limited to 'srv/src/api/tpl')
-rw-r--r--srv/src/api/tpl/index.html48
1 files changed, 28 insertions, 20 deletions
diff --git a/srv/src/api/tpl/index.html b/srv/src/api/tpl/index.html
index b71dc01..1858ea8 100644
--- a/srv/src/api/tpl/index.html
+++ b/srv/src/api/tpl/index.html
@@ -1,28 +1,36 @@
{{ 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>
+
+ <ul id="posts-list">
+
+ {{ range .Posts }}
+ <li>
+ <h2>
+ <a href="posts/{{ .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 }}
- <p>{{ .Description }}</p>
- </li>
- {{ end }}
-</ul>
-{{ end }}
+ </ul>
-{{ if ge .PrevPage 0 }}
-<a href="?p={{ .PrevPage}}">Previous</a>
-{{ end }}
+ {{ if or (ge .PrevPage 0) (ge .NextPage 0) }}
+ <div id="page-turner">
+
+ {{ if ge .PrevPage 0 }}
+ <a style="float: left;" href="?p={{ .PrevPage}}">Newer</a>
+ {{ end }}
+
+ {{ if ge .NextPage 0 }}
+ <a style="float:right;" href="?p={{ .NextPage}}">Older</a>
+ {{ end }}
+
+ </div>
+ {{ end }}
-{{ if ge .NextPage 0 }}
-<a href="?p={{ .NextPage}}">Next</a>
{{ end }}
{{ template "base.html" . }}