diff --git a/layouts/partials/page/prev_next_navigation.html b/layouts/partials/page/prev_next_navigation.html index b584cfa..87ef301 100644 --- a/layouts/partials/page/prev_next_navigation.html +++ b/layouts/partials/page/prev_next_navigation.html @@ -1,6 +1,7 @@ -{{ if .Section }} - {{- $previousInSection := .PrevInSection -}} - {{- $nextInSection := .NextInSection -}} +{{ if .FirstSection }} + {{- $pages := where .FirstSection.RegularPagesRecursive "Draft" "eq" false -}} + {{- $previousInSection := $pages.Prev . -}} + {{- $nextInSection := $pages.Next . -}} {{ if or $previousInSection $nextInSection }}