diff options
| author | Reorx <novoreorx@gmail.com> | 2022-09-08 00:25:50 +0800 |
|---|---|---|
| committer | Reorx <novoreorx@gmail.com> | 2022-09-08 00:25:50 +0800 |
| commit | d9c228117bff094eb3545999364a8533f141467d (patch) | |
| tree | 25b3c0b329f8e964c070fb489a2a02e663bd531d /layouts/partials | |
| parent | 462835f1d875be15e786a3fca8fcc48ac7c57f33 (diff) | |
fix all pages query issues in: list, archives, newsletter section, post_nav_links
Diffstat (limited to 'layouts/partials')
| -rw-r--r-- | layouts/partials/post_nav_links.html | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/layouts/partials/post_nav_links.html b/layouts/partials/post_nav_links.html index 2d1eaa9..c52fbfa 100644 --- a/layouts/partials/post_nav_links.html +++ b/layouts/partials/post_nav_links.html @@ -1,4 +1,11 @@ -{{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} +{{/* get pages from the current page's section */}} +{{- $sections := site.Params.mainSections }} +{{- if .Section }} + {{- $sections = slice .Section }} +{{- end }} +{{ $sections }} +{{- $pages := where (where site.RegularPages "Section" "in" $sections) "Params.hidden" "!=" true }} + {{- if and (gt (len $pages) 1) (in $pages . ) }} <nav class="paginav"> {{- with $pages.Next . }} |
