Skip to content

Commit 5796d17

Browse files
committed
Additional sitemap-main layout updates
Signed-off-by: Ian Maddaus <[email protected]>
1 parent ba6bebb commit 5796d17

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed
Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
1-
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
1+
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
33
xmlns:xhtml="http://www.w3.org/1999/xhtml">
4-
{{ range .Data.Pages }}
5-
{{- if or (eq (isset .Params "sitemapexclude") false) (ne .Params.sitemapExclude true) }}
6-
<url>
7-
<loc>{{ .Permalink }}</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 .Translations }}
11-
<xhtml:link
12-
rel="alternate"
13-
hreflang="{{ .Language.Lang }}"
14-
href="{{ .Permalink }}"
15-
/>{{ end }}
16-
<xhtml:link
17-
rel="alternate"
18-
hreflang="{{ .Language.Lang }}"
19-
href="{{ .Permalink }}"
20-
/>{{ end }}
21-
</url>
22-
{{- end }}
23-
{{ end }}
4+
{{ range where .Pages "Sitemap.Disable" "ne" true }}
5+
{{- if .Permalink -}}
6+
<url>
7+
<loc>{{ .Permalink }}</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 .Translations }}
11+
<xhtml:link
12+
rel="alternate"
13+
hreflang="{{ .Language.LanguageCode }}"
14+
href="{{ .Permalink }}"
15+
/>{{ end }}
16+
<xhtml:link
17+
rel="alternate"
18+
hreflang="{{ .Language.LanguageCode }}"
19+
href="{{ .Permalink }}"
20+
/>{{ end }}
21+
</url>
22+
{{- end -}}
23+
{{ end }}
2424
</urlset>
25-
26-
<!-- From https://dereckcurry.com/posts/excluding-pages-from-the-sitemap/ -->
25+
<!-- hello -->

0 commit comments

Comments
 (0)