From ae447e0220e88e6ec32de5520f36b4e3e93cb0e2 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Sun, 21 May 2023 11:04:42 +0200 Subject: [PATCH] Fix: sommige secties/pagina's werden dubbel getoond in sitemap --- themes/nluug/layouts/custom/sitemap.html | 19 +++++-------------- .../layouts/partials/recursive-pages.html | 11 +++++++++++ 2 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 themes/nluug/layouts/partials/recursive-pages.html diff --git a/themes/nluug/layouts/custom/sitemap.html b/themes/nluug/layouts/custom/sitemap.html index bae303f..659a253 100644 --- a/themes/nluug/layouts/custom/sitemap.html +++ b/themes/nluug/layouts/custom/sitemap.html @@ -3,22 +3,13 @@
{{ .Content }}

Secties

-{{ $sections := (where $.Site.Pages ".Kind" "section").ByTitle }} - -{{ range $sections }} -

{{ .Title | default .Site.Params.textNoTitle }}

- {{ $sectionName := .Section | singularize }} - {{ $pages := (where $.Site.RegularPages ".Section" $sectionName) }} - +{{ range $.Site.Sections.ByTitle }} +

{{ .Title | default .Site.Params.textNoTitle }}

+ {{ partial "recursive-pages.html" . }} {{ end }} +

Laatste wijzigingen

{{ $byLastMod := .Site.RegularPages.ByLastmod.Reverse }}
@@ -34,7 +25,7 @@ - {{ range first 50 $byLastMod }} + {{ range first 20 $byLastMod }} {{ .Lastmod | dateFormat "2006-01-02 15:04:05" }} {{ .Title }} diff --git a/themes/nluug/layouts/partials/recursive-pages.html b/themes/nluug/layouts/partials/recursive-pages.html new file mode 100644 index 0000000..07bc42f --- /dev/null +++ b/themes/nluug/layouts/partials/recursive-pages.html @@ -0,0 +1,11 @@ +{{ $child_pages := union .Sections .Pages }} +