mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
Support files in content mounts
This commit is a general improvement of handling if single file mounts. Fixes #6684 Fixes #6696
This commit is contained in:
@@ -946,6 +946,24 @@ func (p *pageState) sourceRef() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (p *pageState) sourceRefs() []string {
|
||||
refs := []string{p.sourceRef()}
|
||||
|
||||
if !p.File().IsZero() {
|
||||
meta := p.File().FileInfo().Meta()
|
||||
path := meta.PathFile()
|
||||
|
||||
if path != "" {
|
||||
ref := "/" + path
|
||||
if ref != refs[0] {
|
||||
refs = append(refs, ref)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return refs
|
||||
}
|
||||
|
||||
type pageStatePages []*pageState
|
||||
|
||||
// Implement sorting.
|
||||
|
Reference in New Issue
Block a user