Skip to content

Commit 746fac0

Browse files
committed
fix: Disable XML minification for proper sitemap formatting
- Added disableXML = true to minify configuration - Updated sitemap template with better line break handling - Should generate properly formatted XML with line breaks - Google Search Console should be able to parse it correctly
1 parent df9ffc5 commit 746fac0

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

portfolio/config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ canonifyURLs = true
2222
[markup.goldmark.renderer]
2323
unsafe = true
2424

25+
# Minification settings - disable for XML
26+
[minify]
27+
disableXML = true
28+
2529
# SEO and Social
2630
[social]
2731
linkedin = "https://linkedin.com/in/debdyuthajra"

portfolio/layouts/sitemap.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
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
{{- range .Data.Pages }}
44
{{- if ne .Kind "taxonomy" }}
55
<url>
66
<loc>{{ .Permalink }}</loc>
7-
{{- if not .Lastmod.IsZero }}
7+
{{- if not .Lastmod.IsZero }}
88
<lastmod>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" }}</lastmod>
9-
{{- end }}
10-
{{- with .Sitemap.ChangeFreq }}
9+
{{- end }}
10+
{{- with .Sitemap.ChangeFreq }}
1111
<changefreq>{{ . }}</changefreq>
12-
{{- end }}
13-
{{- if ge .Sitemap.Priority 0.0 }}
12+
{{- end }}
13+
{{- if ge .Sitemap.Priority 0.0 }}
1414
<priority>{{ .Sitemap.Priority }}</priority>
15-
{{- end }}
15+
{{- end }}
1616
</url>
1717
{{- end }}
1818
{{- end }}

0 commit comments

Comments
 (0)