Created
February 5, 2024 15:31
-
-
Save MattSLangford/8add08ac89f8a45f3182c3f0db576dd7 to your computer and use it in GitHub Desktop.
Previous/Next Post Links for Tiny Theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ $pages := where site.RegularPages "Type" "post" }} | |
{{ if and (gt (len $pages) 1) (in $pages . ) }} | |
<div class="post-nav"> | |
{{ with $pages.Prev . }} | |
<span class="previous"> | |
<a class="prev" href="{{ .Permalink }}">← Previous Post</a> | |
</span> | |
{{ end }} {{ with $pages.Next . }} | |
<span class="next"> | |
<a class="next" href="{{ .Permalink }}">Next Post →</a> | |
</span> | |
{{ end }} | |
</div> | |
{{ end }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment