From 5dcf7e10e6ea35c25739d5ce342cdecb124b0099 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sun, 24 Mar 2024 08:17:39 +0200 Subject: [PATCH] sitemap.xml: update from upstream Note that in order to exclude a page from sitemap you now need to use the following in the front matter: ``` sitemap: exclude: true ``` --- src/layouts/sitemap.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/layouts/sitemap.xml b/src/layouts/sitemap.xml index 869f1cbe8..9c626df18 100644 --- a/src/layouts/sitemap.xml +++ b/src/layouts/sitemap.xml @@ -1,12 +1,12 @@ {{ printf "" | safeHTML }} - {{- range .Data.Pages -}}{{ if and .Permalink (ne .Params.sitemap_exclude true) }} + {{- range where .Data.Pages "Params.sitemap.exclude" "ne" true -}}{{ if .Permalink }} {{ .Permalink }}{{ if not .Lastmod.IsZero }} {{ safeHTML (.Lastmod.Format "2006-01-02T15:04:05-07:00") }}{{ end }}{{ with .Sitemap.ChangeFreq }} {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} - {{ end }} - {{ end }} + {{ end }} + {{ end }} {{ end }}{{ end }}