tpl: Use AllTranslations in sitemap template

Closes #14912
Closes #14917
This commit is contained in:
Bjørn Erik Pedersen
2026-05-21 19:44:23 +02:00
parent 67aede4364
commit 6475d308ec
2 changed files with 4 additions and 9 deletions
+2 -7
View File
@@ -8,17 +8,12 @@
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ $allTranslations := .AllTranslations }}{{ if gt ($allTranslations | len) 1 }}{{ range $allTranslations }}
<xhtml:link
rel="alternate"
hreflang="{{ .Language.Locale }}"
href="{{ .Permalink }}"
/>{{ end }}
<xhtml:link
rel="alternate"
hreflang="{{ .Language.Locale }}"
href="{{ .Permalink }}"
/>{{ end }}
/>{{ end }}{{ end }}
</url>
{{- end -}}
{{ end }}