From 59e007a86b8924f7b3fa3b1f96edd4f2ad9dd3f4 Mon Sep 17 00:00:00 2001 From: Ian Maddaus Date: Fri, 15 Nov 2024 12:09:52 -0500 Subject: [PATCH] Update main sitemap layout Signed-off-by: Ian Maddaus --- generated/config.toml | 2 +- layouts/_default/home.sitemap-main.xml | 45 +++++++++++++------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/generated/config.toml b/generated/config.toml index 7cf27fce75e..6dd827c86f9 100644 --- a/generated/config.toml +++ b/generated/config.toml @@ -1,6 +1,6 @@ ## Config file for generated dir. -disableKinds = [ "sitemap", "taxonomy", "term", "RSS", "sitemap"] +disableKinds = [ "sitemap", "taxonomy", "term", "RSS"] publishDir = "generated_content" [module] diff --git a/layouts/_default/home.sitemap-main.xml b/layouts/_default/home.sitemap-main.xml index e1a4f42e52a..fe3ec2fa14d 100644 --- a/layouts/_default/home.sitemap-main.xml +++ b/layouts/_default/home.sitemap-main.xml @@ -1,25 +1,26 @@ -{{ printf "" | safeHTML }} +{{ printf "" | safeHTML }} - {{ range where .Pages "Sitemap.Disable" "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 }} +{{ range .Site.Pages }} + {{- if or (eq (isset .Params "sitemapexclude") false) (ne .Params.sitemapExclude true) }} + + {{ .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 }} - \ No newline at end of file + +