mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Fix taxonomy
Recently introduced in master. See https://github.com/gohugoio/hugo/issues/6897#issuecomment-587499907
This commit is contained in:
@@ -537,3 +537,30 @@ categories.funny:|/blog/p1/|
|
||||
`)
|
||||
|
||||
}
|
||||
|
||||
func TestTaxonomiesParent(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
b := newTestSitesBuilder(t)
|
||||
b.WithContent("p.md", `---
|
||||
title: "Page"
|
||||
categories: ["funny"]
|
||||
---
|
||||
|
||||
`)
|
||||
|
||||
b.Build(BuildCfg{})
|
||||
|
||||
cat := b.GetPage("categories")
|
||||
funny := b.GetPage("categories/funny")
|
||||
|
||||
b.Assert(cat, qt.Not(qt.IsNil))
|
||||
b.Assert(funny, qt.Not(qt.IsNil))
|
||||
|
||||
b.Assert(cat.Parent().IsHome(), qt.Equals, true)
|
||||
b.Assert(funny.Parent(), qt.Equals, cat)
|
||||
|
||||
b.AssertFileContent("public/categories/funny/index.xml", `<link>http://example.com/p/</link>`)
|
||||
// TODO https://github.com/gohugoio/hugo/issues/6909 b.AssertFileContent("public/categories/index.xml", `<link>http://example.com/categories/funny/</link>`)
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user