-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Open
Milestone
Description
On Windows, if a mount path has a leading slash, and that path exists relative to the root of the project directory, Hugo finds the path in the project directory and mounts the directory when it shouldn't. Paths with leading slashes are supposed to be relative to the system root.
func TestFoo(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
disableKinds = ['home','rss','section','sitemap','taxonomy','term']
[[module.mounts]]
source = "content"
target = "content"
[[module.mounts]]
source = "/content-other" # leading slash
target = "content"
-- content/p1.md --
---
title: p1
---
-- content-other/p2.md --
---
title: p2
---
-- layouts/_default/single.html --
{{ .Title }}
`
b := hugolib.NewIntegrationTestBuilder(
hugolib.IntegrationTestConfig{
T: t,
TxtarString: files,
NeedsOsFS: true,
}).Build()
b.AssertFileExists("public/p1/index.html", true)
b.AssertFileExists("public/p2/index.html", false) // fails on Windows
}