From accd1aceeb333a93ade69eb2729047ff1fab31e4 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 23 Dec 2024 08:13:30 -0800 Subject: [PATCH] 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 --- assets/css/099_page_navigation.css | 12 ++++++------ layouts/partials/page/prev_next_navigation.html | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/assets/css/099_page_navigation.css b/assets/css/099_page_navigation.css index 99e285b..32de31b 100644 --- a/assets/css/099_page_navigation.css +++ b/assets/css/099_page_navigation.css @@ -15,27 +15,27 @@ justify-content: flex-end; } - li { + .prev, .next { display: block; padding-inline: 0; } - .next-page { + .next { text-align: right; } - .previous-page::before, - .next-page::after { + .prev::before, + .next::after { color: var(--text-color-secondary); font-family: var(--font-family-monospace); } - .previous-page::before { + .prev::before { content: "<-"; padding-inline-end: var(--space-s); } - .next-page::after { + .next::after { content: "->"; padding-inline-start: var(--space-s); } diff --git a/layouts/partials/page/prev_next_navigation.html b/layouts/partials/page/prev_next_navigation.html index 87ef301..e214212 100644 --- a/layouts/partials/page/prev_next_navigation.html +++ b/layouts/partials/page/prev_next_navigation.html @@ -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 }}