diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-12-30 10:50:00 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-01-01 18:19:49 +0100 |
commit | ff6253bc7cf745e9c0127ddc9006da3c2c00c738 (patch) | |
tree | 9e80cc607575e516f4f93e0f16c3e82df3bafdb5 /hugolib/pages_capture.go | |
parent | aa4ccb8a1e9b8aa17397acf34049a2aa16b0b6cb (diff) |
Support files in content mounts
This commit is a general improvement of handling if single file mounts.
Fixes #6684
Fixes #6696
Diffstat (limited to 'hugolib/pages_capture.go')
-rw-r--r-- | hugolib/pages_capture.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hugolib/pages_capture.go b/hugolib/pages_capture.go index 591b8e317..58d652689 100644 --- a/hugolib/pages_capture.go +++ b/hugolib/pages_capture.go @@ -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) |