Skip to content

Commit 0859d9d

Browse files
jamieconnollybep
authored andcommitted
tplimpl: Output xmlns:xhtml only if there are translations available
1 parent 384a6ac commit 0859d9d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎tpl/tplimpl/template_embedded.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ func (t *templateHandler) embedTemplates() {
8787
</channel>
8888
</rss>`)
8989

90-
t.addInternalTemplate("_default", "sitemap.xml", `<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
91-
xmlns:xhtml="http://www.w3.org/1999/xhtml">
90+
t.addInternalTemplate("_default", "sitemap.xml", `<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"{{ if .IsTranslated }}
91+
xmlns:xhtml="http://www.w3.org/1999/xhtml"{{ end }}>
9292
{{ range .Data.Pages }}
9393
<url>
9494
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}

0 commit comments

Comments
 (0)