summaryrefslogtreecommitdiffstats
path: root/create
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-10-16 16:24:49 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-10-20 05:00:17 +0200
commit471ed91c60cd36645794925cb4892cc820eae626 (patch)
treeb78ae6d931e7dd39ccd35a1ed3ff8440f9ef7900 /create
parent94a5bac5b29bbba1ca4809752fe3fd04a58547b6 (diff)
hugofs: Add includeFiles and excludeFiles to mount configuration
Fixes #9042
Diffstat (limited to 'create')
-rw-r--r--create/content.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/create/content.go b/create/content.go
index 7f444f9df..914c16bec 100644
--- a/create/content.go
+++ b/create/content.go
@@ -137,8 +137,9 @@ func (b *contentBuilder) buildDir() error {
if !b.dirMap.siteUsed {
// We don't need to build everything.
contentInclusionFilter = glob.NewFilenameFilterForInclusionFunc(func(filename string) bool {
+ filename = strings.TrimPrefix(filename, string(os.PathSeparator))
for _, cn := range contentTargetFilenames {
- if strings.HasPrefix(cn, filename) {
+ if strings.Contains(cn, filename) {
return true
}
}
@@ -205,7 +206,8 @@ func (b *contentBuilder) buildFile() error {
if !usesSite {
// We don't need to build everything.
contentInclusionFilter = glob.NewFilenameFilterForInclusionFunc(func(filename string) bool {
- return strings.HasPrefix(contentPlaceholderAbsFilename, filename)
+ filename = strings.TrimPrefix(filename, string(os.PathSeparator))
+ return strings.Contains(contentPlaceholderAbsFilename, filename)
})
}