diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2023-01-21 16:46:11 +0100 |
---|---|---|
committer | Brian Picciano <mediocregopher@gmail.com> | 2023-01-21 16:46:11 +0100 |
commit | 293655452cfc6a106c55384e839f9c07d340b954 (patch) | |
tree | c01202bb1722f6f6a0f500f304fa2fbf3c35c34b /src/gmi/tpl | |
parent | 7878db5c95e5eb430b7b878fe6eb8084f15441a7 (diff) |
Continue to polish up posts pages
Diffstat (limited to 'src/gmi/tpl')
-rw-r--r-- | src/gmi/tpl/index.gmi | 4 | ||||
-rw-r--r-- | src/gmi/tpl/posts/index.gmi | 11 | ||||
-rw-r--r-- | src/gmi/tpl/posts/post.gmi | 24 |
3 files changed, 33 insertions, 6 deletions
diff --git a/src/gmi/tpl/index.gmi b/src/gmi/tpl/index.gmi index 7c68b92..9f12e0d 100644 --- a/src/gmi/tpl/index.gmi +++ b/src/gmi/tpl/index.gmi @@ -1,3 +1,3 @@ -# Index +# mediocregopher's lil web corner -=> /posts/index.gmi See all posts +=> /posts/ See all posts diff --git a/src/gmi/tpl/posts/index.gmi b/src/gmi/tpl/posts/index.gmi index 12eb39c..dd4c84c 100644 --- a/src/gmi/tpl/posts/index.gmi +++ b/src/gmi/tpl/posts/index.gmi @@ -1,10 +1,10 @@ # mediocregopher's Posts {{ $page := .GetQueryIntValue "page" 0 -}} -{{ $getPostsRes := .GetPosts $page 20 -}} +{{ $getPostsRes := .GetPosts $page 15 -}} {{ if gt $page 0 -}} -=> /posts.gmi?page={{ .Add $page -1 }} Previous Page +=> /posts/?page={{ .Add $page -1 }} Previous Page {{ end -}} @@ -14,5 +14,8 @@ {{ end -}} {{ if $getPostsRes.HasMore -}} -=> /posts.gmi?page={{ .Add $page 1 }} Next page -{{ end -}} +=> /posts/?page={{ .Add $page 1 }} Next page +{{ end }} +================================================================================ + +=> / Home diff --git a/src/gmi/tpl/posts/post.gmi b/src/gmi/tpl/posts/post.gmi index 52ac5ff..4f58c84 100644 --- a/src/gmi/tpl/posts/post.gmi +++ b/src/gmi/tpl/posts/post.gmi @@ -7,3 +7,27 @@ {{ end -}} {{ $post.Body }} + +-------------------------------------------------------------------------------- + +Published {{ $post.PublishedAt.Format "2006-01-02" }} + +{{- if $post.Series }} + +This post is part of a series! + +{{ $seriesNextPrev := .GetPostSeriesNextPrevious $post -}} + +{{ if $seriesNextPrev.Next -}} +=> /posts/{{ $seriesNextPrev.Next.ID }}.gmi Next: {{ $seriesNextPrev.Next.Title }} +{{ end -}} + +{{ if $seriesNextPrev.Previous -}} +=> /posts/{{ $seriesNextPrev.Previous.ID }}.gmi Previously: {{ $seriesNextPrev.Previous.Title }} +{{ end -}} + +{{ end }} +================================================================================ + +=> /posts/ More posts +=> / Home |