mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +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:
@@ -151,12 +151,11 @@ func newPageCollectionsFromPages(pages pageStatePages) *PageCollections {
|
||||
for _, pageCollection := range []pageStatePages{c.workAllPages, c.headlessPages} {
|
||||
for _, p := range pageCollection {
|
||||
if p.IsPage() {
|
||||
sourceRef := p.sourceRef()
|
||||
if sourceRef != "" {
|
||||
// index the canonical ref
|
||||
// e.g. /section/article.md
|
||||
add(sourceRef, p)
|
||||
sourceRefs := p.sourceRefs()
|
||||
for _, ref := range sourceRefs {
|
||||
add(ref, p)
|
||||
}
|
||||
sourceRef := sourceRefs[0]
|
||||
|
||||
// Ref/Relref supports this potentially ambiguous lookup.
|
||||
add(p.File().LogicalName(), p)
|
||||
@@ -177,11 +176,9 @@ func newPageCollectionsFromPages(pages pageStatePages) *PageCollections {
|
||||
pathWithNoExtensions := path.Join(dir, translationBaseName)
|
||||
add(pathWithNoExtensions, p)
|
||||
} else {
|
||||
// index the canonical, unambiguous ref for any backing file
|
||||
// e.g. /section/_index.md
|
||||
sourceRef := p.sourceRef()
|
||||
if sourceRef != "" {
|
||||
add(sourceRef, p)
|
||||
sourceRefs := p.sourceRefs()
|
||||
for _, ref := range sourceRefs {
|
||||
add(ref, p)
|
||||
}
|
||||
|
||||
ref := p.SectionsPath()
|
||||
|
Reference in New Issue
Block a user