summaryrefslogtreecommitdiff
path: root/src/http/tpl/posts.html
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2024-05-18 18:29:19 +0200
committerBrian Picciano <mediocregopher@gmail.com>2024-05-18 18:29:19 +0200
commit0665d0c65974533fbd313f4e0b062b5103057aeb (patch)
tree5287795eed9767bd959a5139b77ef78b4024216d /src/http/tpl/posts.html
parentffa26298c95451639a6e01db6692d02d50b3d518 (diff)
Replace all URL rendering within templates by a URLConstructor
Diffstat (limited to 'src/http/tpl/posts.html')
-rw-r--r--src/http/tpl/posts.html8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/http/tpl/posts.html b/src/http/tpl/posts.html
index 2fa336d..0df166a 100644
--- a/src/http/tpl/posts.html
+++ b/src/http/tpl/posts.html
@@ -1,11 +1,11 @@
{{ define "body" }}
- {{ $page := .GetQueryIntValue "p" 0 -}}
+ {{ $page := .GetQueryIntValue "page" 0 -}}
{{ $getPostsRes := .GetPosts $page 20 -}}
{{ if gt $page 0 }}
<p>
- <a href="?p={{ .Add $page -1 }}">&lt; &lt; Previous Page</a>
+ <a href="{{ .RootURL.Posts.Page (.Add $page -1) }}">&lt; &lt; Previous Page</a>
</p>
{{ else }}
<p>
@@ -17,7 +17,7 @@
<ul>
{{ range $getPostsRes.Posts }}
<li>
- <strong><a href="{{ PostURL .ID }}">
+ <strong><a href="{{ $.RootURL.Post .ID }}">
{{ .PublishedAt.Format "2006-01-02" }} - {{ .Title }}
</a></strong>
{{ if .Description }}
@@ -29,7 +29,7 @@
{{ if $getPostsRes.HasMore }}
<p>
- <a href="?p={{ .Add $page 1 }}">Next Page &gt; &gt;</a>
+ <a href="{{ .RootURL.Posts.Page (.Add $page 1) }}">Next Page &gt; &gt;</a>
</p>
{{ end }}