commit 0a7f833d6943b31abf3f5880df6b8f56961d8a19 parent 9d546d88ed210c0fb0d057eab6fd28d20a0822ae Author: Michael Neuper <73108749+michaelneuper@users.noreply.github.com> Date: Thu, 15 Dec 2022 11:31:42 +0200 Add next and previous buttons to each post Diffstat:
| M | layouts/_default/single.html | | | 13 | +++++++++++++ |
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/layouts/_default/single.html b/layouts/_default/single.html @@ -20,4 +20,17 @@ {{ .Content }} </main> </div> +<div class="post-navigation"> + {{ if .Prev }} + <a href="{{ .Prev.Permalink }}" class="previous-post"> + Previous post: {{ .Prev.Title }} + </a> + {{ end }} + {{ if .Next }} + <a href="{{ .Next.Permalink }}" class="next-post"> + Next post: {{ .Next.Title }} + </a> + {{ end }} +</div> + {{ partial "footer.html" . }}