Link to sitemap.xml

2nd version

in CONFIG

[outputFormats.SITEMAP]
    MediaType              = "application/xml"
    BaseName               = "sitemap"
    IsHTML                 = false
    IsPlainText            = true
    noUgly                 = true
    Rel                    = "sitemap"

and

[outputs]
    home                   = [ "HTML", "ATOM", "JSON", "FEED", "MANIFEST", "SITEMAP"]
    section                = [ "HTML", "SITEMAP" ]

generating in the header

{{ range .AlternativeOutputFormats }}
	<link rel={{ .Rel }} type="{{ safeHTML .MediaType.Type }}" href={{ .RelPermalink }}>
{{ end }}

if you miss something, look in my public sample

3 Likes