gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
76.1k stars 7.54k forks source link

Bug in overlapping content when ignoring everything #13007

Closed bep closed 3 weeks ago

bep commented 3 weeks ago

Discovered while adding test cases for #12912.

A little hard to explain, but this test setup did not work as expected:

-- hugo.toml --
theme = "t1"
[[module.mounts]]
source = 'content'
target = 'content'
[[module.mounts]]
source = 'content2'
target = 'content/c2'
[[module.mounts]]
source = 'content3'
target = 'content/watchdisabled'
disableWatch = true
[[module.mounts]]
source = 'content4'
target = 'content/excludedsome'
excludeFiles = 'p1.md'
[[module.mounts]]
source = 'content5'
target = 'content/excludedall'
excludeFiles = '/**'
[[module.mounts]]
source = "hugo_stats.json"
target = "assets/watching/hugo_stats.json"
-- hugo_stats.json --
Some stats.
-- content/foo.md --
foo
-- content2/bar.md --
-- themes/t1/layouts/_default/single.html --
{{ .Content }}
-- themes/t1/static/f1.txt --
-- content3/p1.md --
-- content4/p1.md --
-- content4/p2.md --
-- content5/p3.md --
-- content5/p4.md --

The excludeFiles = '/**' effectively excluded the entire mount (correct), but due to a logic error in the code, we skipped all the other content mounts mounted to the same target root.

I don't suspect this to be a common setup, though.

github-actions[bot] commented 4 hours ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.