summaryrefslogtreecommitdiffstats
path: root/hugolib/filesystems
diff options
context:
space:
mode:
authorSatowTakeshi <doublequotation@gmail.com>2021-04-18 16:13:00 +0900
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-03-08 19:27:54 +0100
commit7d8011ed63d587b87a7c182748914fe146590093 (patch)
treecde6c99c5a439e64e0a2e5c9d2f0d4b03eba6577 /hugolib/filesystems
parentb9a1be2f9961516a674ff15a409433606e70ac7b (diff)
Allow rendering static files to disk and dynamic to memory in server mode
Updates #9625
Diffstat (limited to 'hugolib/filesystems')
-rw-r--r--hugolib/filesystems/basefs.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/hugolib/filesystems/basefs.go b/hugolib/filesystems/basefs.go
index 2e32932c6..1614bd0b3 100644
--- a/hugolib/filesystems/basefs.go
+++ b/hugolib/filesystems/basefs.go
@@ -71,6 +71,9 @@ type BaseFs struct {
// A read-only filesystem starting from the project workDir.
WorkDir afero.Fs
+ // The filesystem used for renderStaticToDisk.
+ PublishFsStatic afero.Fs
+
theBigFs *filesystemsCollector
// Locks.
@@ -438,15 +441,17 @@ func NewBase(p *paths.Paths, logger loggers.Logger, options ...func(*BaseFs) err
publishFs := hugofs.NewBaseFileDecorator(afero.NewBasePathFs(fs.Destination, p.AbsPublishDir))
sourceFs := hugofs.NewBaseFileDecorator(afero.NewBasePathFs(fs.Source, p.WorkingDir))
+ publishFsStatic := afero.NewBasePathFs(fs.Source, p.AbsPublishDir)
// Same as sourceFs, but no decoration. This is what's used by os.ReadDir etc.
workDir := afero.NewBasePathFs(afero.NewReadOnlyFs(fs.Source), p.WorkingDir)
b := &BaseFs{
- SourceFs: sourceFs,
- WorkDir: workDir,
- PublishFs: publishFs,
- buildMu: lockedfile.MutexAt(filepath.Join(p.WorkingDir, lockFileBuild)),
+ SourceFs: sourceFs,
+ WorkDir: workDir,
+ PublishFs: publishFs,
+ PublishFsStatic: publishFsStatic,
+ buildMu: lockedfile.MutexAt(filepath.Join(p.WorkingDir, lockFileBuild)),
}
for _, opt := range options {