mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
hugofs: Add includeFiles and excludeFiles to mount configuration
Fixes #9042
This commit is contained in:
@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user