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:
@@ -116,7 +116,7 @@ func (c *pagesCollector) Collect() error {
|
||||
} else {
|
||||
dirs := make(map[contentDirKey]bool)
|
||||
for _, filename := range c.filenames {
|
||||
dir, filename, btype := c.tracker.resolveAndRemove(filename)
|
||||
dir, btype := c.tracker.resolveAndRemove(filename)
|
||||
dirs[contentDirKey{dir, filename, btype}] = true
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ func (c *pagesCollector) Collect() error {
|
||||
default:
|
||||
// We always start from a directory.
|
||||
collectErr = c.collectDir(dir.dirname, true, func(fim hugofs.FileMetaInfo) bool {
|
||||
return strings.HasSuffix(dir.filename, fim.Meta().Path())
|
||||
return dir.filename == fim.Meta().Filename()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -211,6 +211,7 @@ func (c *pagesCollector) collectDir(dirname string, partial bool, inFilter func(
|
||||
for _, fi := range readdir {
|
||||
if filter(fi) {
|
||||
filtered = append(filtered, fi)
|
||||
|
||||
if c.tracker != nil {
|
||||
// Track symlinks.
|
||||
c.tracker.addSymbolicLinkMapping(fi)
|
||||
|
Reference in New Issue
Block a user