A couple fixes for page navigation

- Put the previous post on the left, and the next post on the right
- Simplify the CSS class names and styles
This commit is contained in:
Eryn Wells 2024-12-23 08:13:30 -08:00
parent 1eba82c96b
commit accd1aceeb
2 changed files with 9 additions and 9 deletions

View file

@ -1,18 +1,18 @@
{{ if .FirstSection }}
{{- $pages := where .FirstSection.RegularPagesRecursive "Draft" "eq" false -}}
{{- $pages := (where .FirstSection.RegularPagesRecursive "Draft" "eq" false).ByDate -}}
{{- $previousInSection := $pages.Prev . -}}
{{- $nextInSection := $pages.Next . -}}
{{ if or $previousInSection $nextInSection }}
<ul class="page-navigation">
{{ with $nextInSection -}}
<li class="previous-page">
<li class="prev">
<a href="{{ .Permalink }}">{{ .LinkTitle | markdownify }}</a>
</li>
{{- end }}
{{ with $previousInSection -}}
<li class="next-page">
<li class="next">
<a href="{{ .Permalink }}">{{ .LinkTitle | markdownify }}</a>
</li>
{{- end }}