mirror of
https://github.com/gohugoio/hugo.git
synced 2025-05-01 16:10:07 +03:00
Merge e4f26ffb66
into 07983e04e2
This commit is contained in:
commit
8bb900c20e
2 changed files with 23 additions and 1 deletions
|
@ -172,7 +172,7 @@ func (h *HugoSites) doNewPage(m *pageMeta) (*pageState, *paths.Path, error) {
|
||||||
}
|
}
|
||||||
m.singular = tc.singular
|
m.singular = tc.singular
|
||||||
if m.pageConfig.Kind == kinds.KindTerm {
|
if m.pageConfig.Kind == kinds.KindTerm {
|
||||||
m.term = paths.TrimLeading(strings.TrimPrefix(m.pathInfo.Unnormalized().Base(), tc.pluralTreeKey))
|
m.term = paths.TrimLeading(strings.TrimPrefix(m.pathInfo.Unnormalized().Base(), "/"+tc.plural))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1968,3 +1968,25 @@ Title: {{ .Title }}
|
||||||
"deprecated: path in front matter was deprecated",
|
"deprecated: path in front matter was deprecated",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// See #13422
|
||||||
|
func TestPageTermWithSpaceInTaxonomyName(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
files := `
|
||||||
|
-- hugo.toml --
|
||||||
|
[taxonomies]
|
||||||
|
"book author" = "book authors"
|
||||||
|
-- content/p1.md --
|
||||||
|
---
|
||||||
|
title: "p1"
|
||||||
|
kind: "page"
|
||||||
|
lang: "en"
|
||||||
|
path: "mypath"
|
||||||
|
book authors: ["Author One"]
|
||||||
|
---
|
||||||
|
-- layouts/_default/term.html --
|
||||||
|
{{ .Data.Term }}
|
||||||
|
`
|
||||||
|
b := Test(t, files, TestOptWarn())
|
||||||
|
b.AssertFileContent("public/book-authors/author-one/index.html", "Author One")
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue