Created
April 8, 2017 22:44
-
-
Save nfriedli/1d40763fc9d3d9d48fd0ae05c018f1e0 to your computer and use it in GitHub Desktop.
Multilingual sitemap.xml for GoHugo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> | |
{{ range .Data.Pages }} | |
<url> | |
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }} | |
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }} | |
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }} | |
<priority>{{ .Sitemap.Priority }}</priority>{{ end }} | |
{{ if .IsTranslated }} | |
<xhtml:link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}"/> | |
{{ range .Translations }} | |
<xhtml:link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}"/> | |
{{ end}} | |
{{ end }} | |
</url> | |
{{ end }} | |
</urlset> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment