Skip to content

Commit df9ffc5

Browse files
committed
fix: Create proper XML sitemap template
- Added correctly formatted sitemap.xml template in layouts/ - Includes proper XML declaration and urlset tags - Excludes taxonomy pages that were causing issues - Should generate valid XML instead of malformed content
1 parent 49f662e commit df9ffc5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

portfolio/layouts/sitemap.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
2+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3+
{{- range .Data.Pages }}
4+
{{- if ne .Kind "taxonomy" }}
5+
<url>
6+
<loc>{{ .Permalink }}</loc>
7+
{{- if not .Lastmod.IsZero }}
8+
<lastmod>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" }}</lastmod>
9+
{{- end }}
10+
{{- with .Sitemap.ChangeFreq }}
11+
<changefreq>{{ . }}</changefreq>
12+
{{- end }}
13+
{{- if ge .Sitemap.Priority 0.0 }}
14+
<priority>{{ .Sitemap.Priority }}</priority>
15+
{{- end }}
16+
</url>
17+
{{- end }}
18+
{{- end }}
19+
</urlset>

0 commit comments

Comments
 (0)