diff options
author | Bjørn Erik Pedersen <[email protected]> | 2020-02-18 16:16:09 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2020-02-18 16:43:36 +0100 |
commit | 1b7acfe7634a5d7bbc597ef4dddf4babce5666c5 (patch) | |
tree | e8f3cd72148661c050afda184a9a98f4eaa3dc5a /hugolib/taxonomy_test.go | |
parent | 19e12caf8c90516e3b803ae8a40b907bd89dc96c (diff) | |
download | hugo-1b7acfe7634a5d7bbc597ef4dddf4babce5666c5.tar.gz hugo-1b7acfe7634a5d7bbc597ef4dddf4babce5666c5.zip |
Fix taxonomy
Recently introduced in master.
See https://github.com/gohugoio/hugo/issues/6897#issuecomment-587499907
Diffstat (limited to 'hugolib/taxonomy_test.go')
-rw-r--r-- | hugolib/taxonomy_test.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/hugolib/taxonomy_test.go b/hugolib/taxonomy_test.go index 7c0644d51..abe4b97cd 100644 --- a/hugolib/taxonomy_test.go +++ b/hugolib/taxonomy_test.go @@ -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>`) + +} |