diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-07-12 10:09:32 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-07-12 12:18:56 +0200 |
commit | 80c8f3b81a9849080e64bf877288ede28d960d3f (patch) | |
tree | 915da0911088942d85584d469fe39e497f34a6eb /hugolib/filesystems/basefs.go | |
parent | 6b6dcb44a014699c289bf32fe57d4c4216777be0 (diff) |
hugolib: Fix static filesystem for themed multihost sites
Multihost is where each language has its own `baseURL`. In this configuration, static files from the theme was not picked up.
This was a regression in Hugo `0.42`. This commit also adds proper tests for this, so that does not happen again.
Fixes #4929
Diffstat (limited to 'hugolib/filesystems/basefs.go')
-rw-r--r-- | hugolib/filesystems/basefs.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/hugolib/filesystems/basefs.go b/hugolib/filesystems/basefs.go index f453e411e..1a99da17b 100644 --- a/hugolib/filesystems/basefs.go +++ b/hugolib/filesystems/basefs.go @@ -499,7 +499,6 @@ func (b *sourceFilesystemsBuilder) createRootMappingFs(dirKey, themeFolder strin s.Fs = afero.NewReadOnlyFs(fs) return s, nil - } func (b *sourceFilesystemsBuilder) existsInSource(abspath string) bool { @@ -536,6 +535,14 @@ func (b *sourceFilesystemsBuilder) createStaticFs() error { return err } + if b.hasTheme { + themeFolder := "static" + fs = afero.NewCopyOnWriteFs(newRealBase(afero.NewBasePathFs(b.themeFs, themeFolder)), fs) + for _, absThemeDir := range b.absThemeDirs { + s.Dirnames = append(s.Dirnames, filepath.Join(absThemeDir, themeFolder)) + } + } + s.Fs = fs ms[l.Lang] = s |