From 6ea7f867527346ebdad7c3dcbc815bf7d0dcf60f Mon Sep 17 00:00:00 2001 From: Nick Lyons Date: Tue, 26 Mar 2024 15:03:22 -0400 Subject: [PATCH 1/3] Testing sitemap redirectto location --- content/sitemap.md | 2 ++ themes/digital.gov/layouts/{ => _default}/sitemap.xml | 0 2 files changed, 2 insertions(+) rename themes/digital.gov/layouts/{ => _default}/sitemap.xml (100%) diff --git a/content/sitemap.md b/content/sitemap.md index c387d75ce9..743608afae 100644 --- a/content/sitemap.md +++ b/content/sitemap.md @@ -1,4 +1,6 @@ --- title: Digital.gov Sitemap +slug: sitemap +url: /sitemap redirectto: /sitemap.xml --- diff --git a/themes/digital.gov/layouts/sitemap.xml b/themes/digital.gov/layouts/_default/sitemap.xml similarity index 100% rename from themes/digital.gov/layouts/sitemap.xml rename to themes/digital.gov/layouts/_default/sitemap.xml From 0dacd1c764f14b9f7ca1009eab3f4f1b62d0f959 Mon Sep 17 00:00:00 2001 From: Nick Lyons Date: Tue, 26 Mar 2024 15:19:35 -0400 Subject: [PATCH 2/3] Removed sitemap.md for testing --- content/sitemap.md | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 content/sitemap.md diff --git a/content/sitemap.md b/content/sitemap.md deleted file mode 100644 index 743608afae..0000000000 --- a/content/sitemap.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Digital.gov Sitemap -slug: sitemap -url: /sitemap -redirectto: /sitemap.xml ---- From 8a8597503b804cb276cb061cbb112b7057c41d07 Mon Sep 17 00:00:00 2001 From: Nick Lyons Date: Tue, 26 Mar 2024 15:24:37 -0400 Subject: [PATCH 3/3] Moved sitemap.xml to /layouts --- themes/digital.gov/layouts/sitemap.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 themes/digital.gov/layouts/sitemap.xml diff --git a/themes/digital.gov/layouts/sitemap.xml b/themes/digital.gov/layouts/sitemap.xml new file mode 100644 index 0000000000..5a4f8613d4 --- /dev/null +++ b/themes/digital.gov/layouts/sitemap.xml @@ -0,0 +1,10 @@ + + {{ range .Data.Pages }} + + https://digital.gov{{ .Permalink | relURL }}{{ 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 }} + + {{ end }} +