File tree 2 files changed +26
-1
lines changed
2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -123,3 +123,28 @@ func TestParseSitemap(t *testing.T) {
123
123
t .Errorf ("Got \n %v expected \n %v" , result , expected )
124
124
}
125
125
}
126
+
127
+ func TestSitemapShouldNotUseListXML (t * testing.T ) {
128
+ t .Parallel ()
129
+
130
+ files := `
131
+ -- hugo.toml --
132
+ baseURL = "https://example.com"
133
+ disableKinds = ["term", "taxonomy"]
134
+ [languages]
135
+ [languages.en]
136
+ weight = 1
137
+ languageName = "English"
138
+ [languages.nn]
139
+ weight = 2
140
+ -- layouts/_default/list.xml --
141
+ Site: {{ .Site.Title }}|
142
+ -- layouts/home --
143
+ Home.
144
+
145
+ `
146
+
147
+ b := Test (t , files )
148
+
149
+ b .AssertFileContent ("public/sitemap.xml" , "https://example.com/en/sitemap.xml" )
150
+ }
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ type LayoutDescriptor struct {
50
50
}
51
51
52
52
func (d LayoutDescriptor ) isList () bool {
53
- return ! d .RenderingHook && d .Kind != "page" && d .Kind != "404"
53
+ return ! d .RenderingHook && d .Kind != "page" && d .Kind != "404" && d . Kind != "sitemap" && d . Kind != "sitemapindex"
54
54
}
55
55
56
56
// LayoutHandler calculates the layout template to use to render a given output type.
You can’t perform that action at this time.
0 commit comments