diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml index 9d9adb4..39cc002 100644 --- a/layouts/_default/sitemap.xml +++ b/layouts/_default/sitemap.xml @@ -1,21 +1,20 @@ {{ printf "" | safeHTML }} - + {{ range $page := .Data.Pages }} - {{- $incldueURL := true -}} - {{- range $val := $.Site.Params.sitemapFilter -}} - {{- if (strings.Contains $page.Permalink $val ) -}} - {{- $incldueURL = false -}} - {{- end -}} + {{- $includeURL := true -}} + {{- range $val := $.Site.Params.sitemapFilter -}} + {{- if (in $page.Permalink $val) -}} + {{- $includeURL = false -}} + {{- end -}} {{- end -}} - {{- if and .Permalink $incldueURL -}} + {{- if and $page.Permalink $includeURL -}} - {{ .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 }} + {{ $page.Permalink }}{{ if not $page.Lastmod.IsZero }} + {{ $page.Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}{{ end }}{{ with $page.Sitemap.ChangeFreq }} + {{ . }}{{ end }}{{ if ge $page.Sitemap.Priority 0.0 }} + {{ $page.Sitemap.Priority }}{{ end }}{{ if $page.IsTranslated }}{{ range $page.Translations }} + {{ end }}{{ end }} {{- end -}} {{ end }} - \ No newline at end of file +