fix: sitemap xml

update date format, remove double slash in xsl path in prod, replace
non-breaking spaces with regular spaces

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2024-08-21 14:27:53 +02:00
parent 303cb10e31
commit 2e44563227
1 changed files with 6 additions and 6 deletions

View File

@ -1,14 +1,14 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
{{ printf "<?xml-stylesheet type=\"text/xsl\" href=\"%s/sitemap.xsl\"?>" site.BaseURL | safeHTML }}
{{ printf "<?xml-stylesheet type=\"text/xsl\" href=\"%s\"?>" (urls.AbsURL "sitemap.xml") | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{{- range where site.Pages "Params.sitemap" "!=" false }}
{{- if ne .Params.sitemap false }}
  <url>
<url>
<loc>{{ .Permalink}}</loc>
<lastmod>{{ .Lastmod }}</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.5</priority>
  </url>
<lastmod>{{ .Lastmod | time.Format "2006-01-02" }}</lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
{{- end }}
{{- end }}
</urlset>