|
1 | 1 | {{- partialCached "page-meta.hugo" . .RelPermalink }} |
2 | 2 | {{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }} |
3 | 3 | <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> |
4 | | -{{- range .Data.Pages }} |
| 4 | +{{- range where .Pages "Sitemap.Disable" "ne" true }} |
5 | 5 | {{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSeoHiddenPages true) ) }} |
6 | 6 | <url> |
7 | | - <loc>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</loc> |
8 | | - {{- if not .Lastmod.IsZero }} |
9 | | - <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod> |
10 | | - {{- end }} |
11 | | - {{- with .Sitemap.ChangeFreq }} |
12 | | - <changefreq>{{ . }}</changefreq> |
13 | | - {{- end }} |
14 | | - {{- if ge .Sitemap.Priority 0.0 }} |
15 | | - <priority>{{ .Sitemap.Priority }}</priority> |
16 | | - {{- end }} |
17 | | - {{- if .IsTranslated }} |
18 | | - {{- range $index, $trans := .AllTranslations }} |
19 | | - {{- if eq $index 0 }} |
20 | | - <xhtml:link rel="alternate" hreflang="x-default" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}" /> |
21 | | - {{- end }} |
22 | | - <xhtml:link rel="alternate" hreflang="{{ .Language.LanguageCode }}" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}" /> |
23 | | - {{- end }} |
24 | | - {{- end }} |
| 7 | + <loc>{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}</loc>{{ if not .Lastmod.IsZero }} |
| 8 | + <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }} |
| 9 | + <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }} |
| 10 | + <priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range $index, $trans := .AllTranslations }}{{- if eq $index 0 }} |
| 11 | + <xhtml:link rel="alternate" hreflang="x-default" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}" />{{ end }} |
| 12 | + <xhtml:link rel="alternate" hreflang="{{ .Language.LanguageCode }}" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true) }}" />{{ end }}{{ end }} |
25 | 13 | </url> |
26 | 14 | {{- end -}} |
27 | 15 | {{- end }} |
|
0 commit comments