mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-27 22:09:53 +02:00
hugolib: Fix handling of pages bundled in sub-folders in ByPrefix etc.
Fixes #4295
This commit is contained in:
@@ -234,6 +234,8 @@ type Page struct {
|
||||
// relative target path without extension and any base path element from the baseURL.
|
||||
// This is used to construct paths in the page resources.
|
||||
relTargetPathBase string
|
||||
// Is set to a forward slashed path if this is a Page resources living in a folder below its owner.
|
||||
resourcePath string
|
||||
|
||||
layoutDescriptor output.LayoutDescriptor
|
||||
|
||||
@@ -993,9 +995,10 @@ func (p *Page) RelPermalink() string {
|
||||
}
|
||||
|
||||
// See resource.Resource
|
||||
// This value is used, by default, in Resources.ByPrefix etc.
|
||||
func (p *Page) Name() string {
|
||||
if p.File != nil {
|
||||
return p.File.BaseFileName()
|
||||
if p.resourcePath != "" {
|
||||
return p.resourcePath
|
||||
}
|
||||
return p.title
|
||||
}
|
||||
|
Reference in New Issue
Block a user