mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
resources/page: Allow section and taxonomy pages to have a permalink configuration
Allows using permalink configuration for sections (branch bundles) and also for taxonomy pages. Extends the current permalink configuration to be able to specified per page kind while also staying backward compatible: all permalink patterns not dedicated to a certain kind, get automatically added for both normal pages and term pages. Fixes #8523
This commit is contained in:
@@ -221,7 +221,7 @@ func generateFileIsZeroWrappers(c *codegen.Inspector) error {
|
||||
methods := c.MethodsFromTypes([]reflect.Type{reflect.TypeOf((*source.File)(nil)).Elem()}, nil)
|
||||
|
||||
for _, m := range methods {
|
||||
if m.Name == "IsZero" {
|
||||
if m.Name == "IsZero" || m.Name == "Classifier" {
|
||||
continue
|
||||
}
|
||||
fmt.Fprint(&buff, m.DeclarationNamed("zeroFile"))
|
||||
@@ -255,6 +255,11 @@ func (zeroFile) IsZero() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (z zeroFile) Classifier() files.ContentClass {
|
||||
z.log.Warnln(".File.Classifier on zero object. Wrap it in if or with: {{ with .File }}{{ .Classifier }}{{ end }}")
|
||||
return files.ContentClassZero
|
||||
}
|
||||
|
||||
%s
|
||||
|
||||
`, header, importsString(pkgImports), buff.String())
|
||||
|
Reference in New Issue
Block a user