mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
@@ -243,3 +243,44 @@ subcats:
|
||||
th.assertFileContent(pathFunc("public/empties/index.html"), "Terms List", "Empties")
|
||||
|
||||
}
|
||||
|
||||
// https://github.com/gohugoio/hugo/issues/5513
|
||||
func TestTaxonomyPathSeparation(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
config := `
|
||||
baseURL = "https://example.com"
|
||||
|
||||
[taxonomies]
|
||||
"news/tag" = "news/tags"
|
||||
"news/category" = "news/categories"
|
||||
`
|
||||
|
||||
pageContent := `
|
||||
+++
|
||||
title = "foo"
|
||||
"news/categories" = ["a", "b", "c"]
|
||||
+++
|
||||
|
||||
Content.
|
||||
|
||||
|
||||
`
|
||||
|
||||
b := newTestSitesBuilder(t)
|
||||
b.WithConfigFile("toml", config)
|
||||
b.WithContent("page.md", pageContent)
|
||||
b.WithContent("news/categories/b/_index.md", `
|
||||
---
|
||||
title: "This is B"
|
||||
---
|
||||
|
||||
`)
|
||||
|
||||
b.CreateSites().Build(BuildCfg{})
|
||||
|
||||
b.AssertFileContent("public/news/categories/index.html", "Taxonomy Term Page 1|News/Categories|Hello|https://example.com/news/categories/|")
|
||||
b.AssertFileContent("public/news/categories/a/index.html", "Taxonomy List Page 1|A|Hello|https://example.com/news/categories/a/|")
|
||||
b.AssertFileContent("public/news/categories/b/index.html", "Taxonomy List Page 1|This is B|Hello|https://example.com/news/categories/b/|")
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user