mykiwi/mykiwi.blogpublic Fork
⑂ 03340bb
Commits
⬇ Clone ▾
git clone https://git.rickub.com/mykiwi/mykiwi.blog.git
git clone ssh://git@rickub.com/mykiwi/mykiwi.blog.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

Say hreflang the same way baseof.html's own link tags say it

Hugo's stock sitemap spells the xhtml:link hreflang as a locale
(en-us, fr-fr, pt-br); the <link rel="alternate"> tags already on
every page spell it as the bare language code (en, fr, pt). A search
engine reading two spellings of the same alternate off the same site
reads them as two different signals, not one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Romain Gautier committed 2026-09-22T22:22:29+02:00 Browse files
03340bb parent: 2b9977b
added blog/layouts/sitemap.xml +31 -0
new file mode 100644
@@ -0,0 +1,31 @@
1+{{- /*
2+ Hugo's stock sitemap, with one change: the xhtml:link hreflang is the bare
3+ language code (en, fr, pt), the same value baseof.html's <link rel="alternate">
4+ tags use, instead of the locale (en-us, fr-fr, pt-br). Two spellings of the
5+ same alternate is what a search engine reads as two different signals.
6+*/ -}}
7+{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
8+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
9+ xmlns:xhtml="http://www.w3.org/1999/xhtml">
10+ {{- range .Pages }}
11+ {{- if .Permalink }}
12+ <url>
13+ <loc>{{ .Permalink }}</loc>
14+ {{- if not .Lastmod.IsZero }}
15+ <lastmod>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</lastmod>
16+ {{- end }}
17+ {{- with .Sitemap.ChangeFreq }}
18+ <changefreq>{{ . }}</changefreq>
19+ {{- end }}
20+ {{- if ge .Sitemap.Priority 0.0 }}
21+ <priority>{{ .Sitemap.Priority }}</priority>
22+ {{- end }}
23+ {{- if .IsTranslated }}
24+ {{- range .AllTranslations }}
25+ <xhtml:link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}"/>
26+ {{- end }}
27+ {{- end }}
28+ </url>
29+ {{- end }}
30+ {{- end }}
31+</urlset>
new file mode 100644
@@ -0,0 +1,31 @@
1+{{- /*
2+ Hugo's stock sitemap, with one change: the xhtml:link hreflang is the bare
3+ language code (en, fr, pt), the same value baseof.html's <link rel="alternate">
4+ tags use, instead of the locale (en-us, fr-fr, pt-br). Two spellings of the
5+ same alternate is what a search engine reads as two different signals.
6+*/ -}}
7+{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
8+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
9+ xmlns:xhtml="http://www.w3.org/1999/xhtml">
10+ {{- range .Pages }}
11+ {{- if .Permalink }}
12+ <url>
13+ <loc>{{ .Permalink }}</loc>
14+ {{- if not .Lastmod.IsZero }}
15+ <lastmod>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</lastmod>
16+ {{- end }}
17+ {{- with .Sitemap.ChangeFreq }}
18+ <changefreq>{{ . }}</changefreq>
19+ {{- end }}
20+ {{- if ge .Sitemap.Priority 0.0 }}
21+ <priority>{{ .Sitemap.Priority }}</priority>
22+ {{- end }}
23+ {{- if .IsTranslated }}
24+ {{- range .AllTranslations }}
25+ <xhtml:link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}"/>
26+ {{- end }}
27+ {{- end }}
28+ </url>
29+ {{- end }}
30+ {{- end }}
31+</urlset>