diff --git a/hugo.toml b/hugo.toml index 56d6dfba..0e75ab6b 100644 --- a/hugo.toml +++ b/hugo.toml @@ -197,6 +197,7 @@ enableEmoji = true [sitemap] changefreq = "weekly" + disable = false filename = "sitemap.xml" priority = 0.5 diff --git a/layouts/partials/init/index.html b/layouts/partials/init/index.html index ad0e9707..9ea48b94 100644 --- a/layouts/partials/init/index.html +++ b/layouts/partials/init/index.html @@ -1,4 +1,4 @@ -{{- .Scratch.Set "version" "v0.3.13-95436c11" -}} +{{- .Scratch.Set "version" "v0.3.13-b32f1a99" -}} {{- .Scratch.Set "this" dict -}} {{- partial "init/detection-env.html" . -}} diff --git a/layouts/sitemap.xml b/layouts/sitemap.xml index 85a020cd..d4ca5953 100644 --- a/layouts/sitemap.xml +++ b/layouts/sitemap.xml @@ -1,47 +1,12 @@ - - {{- range (where .Data.Pages "Section" "!=" "gallery") -}} - - - {{- .Permalink -}} - - {{- if not .Lastmod.IsZero -}} - - {{- .Lastmod.Format "2006-01-02T15:04:05-07:00" -}} - - {{- end -}} - {{- with .Sitemap.ChangeFreq -}} - - {{- . -}} - - {{- end -}} - - {{- if ge .Sitemap.Priority 0.0 -}} - {{- $weeks := div (sub now.Unix .Lastmod.Unix) 604800 -}} - {{- $priority := sub 1 (div $weeks 10.0 ) -}} - {{- if ge .Sitemap.Priority $priority -}} - {{ .Sitemap.Priority }} - {{- else -}} - {{ $priority }} - {{- end -}} - {{- end -}} - - {{- if .IsTranslated -}} - {{- range .Translations -}} - - {{- end -}} - - {{- end -}} - - {{- end -}} +{{ 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 }}