Don't use the baseURL /path as part of the resource cache key

As that prevents Hugo projects with sub paths in their `baseURL` to use themes with cached resources.

Fixes #9787
This commit is contained in:
Bjørn Erik Pedersen 2022-05-27 13:23:37 +02:00
parent 46a2ea6d0d
commit dd9eaf19fd
3 changed files with 83 additions and 21 deletions

View file

@ -41,13 +41,15 @@ func NewIntegrationTestBuilder(conf IntegrationTestConfig) *IntegrationTestBuild
}
if conf.NeedsOsFS {
tempDir, clean, err := htesting.CreateTempDir(hugofs.Os, "hugo-integration-test")
c.Assert(err, qt.IsNil)
conf.WorkingDir = filepath.Join(tempDir, conf.WorkingDir)
if !conf.PrintAndKeepTempDir {
c.Cleanup(clean)
} else {
fmt.Println("\nUsing WorkingDir dir:", conf.WorkingDir)
if !filepath.IsAbs(conf.WorkingDir) {
tempDir, clean, err := htesting.CreateTempDir(hugofs.Os, "hugo-integration-test")
c.Assert(err, qt.IsNil)
conf.WorkingDir = filepath.Join(tempDir, conf.WorkingDir)
if !conf.PrintAndKeepTempDir {
c.Cleanup(clean)
} else {
fmt.Println("\nUsing WorkingDir dir:", conf.WorkingDir)
}
}
} else if conf.WorkingDir == "" {
conf.WorkingDir = helpers.FilePathSeparator