mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
60b176cb57
commit
5ada27bf65
2 changed files with 30 additions and 0 deletions
|
@ -1904,6 +1904,9 @@ func (m *pageMap) CreateSiteTaxonomies(ctx context.Context) error {
|
||||||
|
|
||||||
switch p.Kind() {
|
switch p.Kind() {
|
||||||
case kinds.KindTerm:
|
case kinds.KindTerm:
|
||||||
|
if !p.m.shouldList(true) {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
taxonomy := m.s.taxonomies[viewName.plural]
|
taxonomy := m.s.taxonomies[viewName.plural]
|
||||||
if taxonomy == nil {
|
if taxonomy == nil {
|
||||||
return true, fmt.Errorf("missing taxonomy: %s", viewName.plural)
|
return true, fmt.Errorf("missing taxonomy: %s", viewName.plural)
|
||||||
|
|
|
@ -858,3 +858,30 @@ draft: true
|
||||||
|
|
||||||
b.AssertFileExists("public/tags/a/index.html", false)
|
b.AssertFileExists("public/tags/a/index.html", false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestTermBuildNeverRenderNorList(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
files := `
|
||||||
|
-- layouts/index.html --
|
||||||
|
|{{ len site.Taxonomies.tags }}|
|
||||||
|
-- content/p1.md --
|
||||||
|
---
|
||||||
|
title: p1
|
||||||
|
tags: [a]
|
||||||
|
---
|
||||||
|
-- content/tags/a/_index.md --
|
||||||
|
---
|
||||||
|
title: tag-a-title-override
|
||||||
|
build:
|
||||||
|
render: never
|
||||||
|
list: never
|
||||||
|
---
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
b := Test(t, files)
|
||||||
|
|
||||||
|
b.AssertFileExists("public/tags/a/index.html", false)
|
||||||
|
b.AssertFileContent("public/index.html", "|0|")
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue