diff --git a/layouts/sitemap.xml b/layouts/sitemap.xml index d13d9280..f931c442 100644 --- a/layouts/sitemap.xml +++ b/layouts/sitemap.xml @@ -17,11 +17,17 @@ {{- . -}} {{- end -}} + {{- if ge .Sitemap.Priority 0.0 -}} - - {{- .Sitemap.Priority -}} - + {{- $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 -}}