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:
Bjørn Erik Pedersen
2019-12-30 10:50:00 +01:00
parent aa4ccb8a1e
commit ff6253bc7c
10 changed files with 273 additions and 55 deletions

View File

@@ -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()