Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-03-11 11:48:20 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-03-11 15:10:47 +0300
commit64b7b7a89753a39661219b2fcb92d7f185a03f63 (patch)
treefc0a936c03faffd4acfd28b4997f499e4109dcfb /commands/commandeer.go
parent5ef8a9f32c25a9b4cc821393c58733e57a7ad234 (diff)
Revert "Allow rendering static files to disk and dynamic to memory in server mode"
This reverts commit 7d8011ed63d587b87a7c182748914fe146590093. Updates #9647
Diffstat (limited to 'commands/commandeer.go')
-rw-r--r--commands/commandeer.go14
1 files changed, 1 insertions, 13 deletions
diff --git a/commands/commandeer.go b/commands/commandeer.go
index 07181f244..bf42501e0 100644
--- a/commands/commandeer.go
+++ b/commands/commandeer.go
@@ -92,7 +92,6 @@ type commandeer struct {
languagesConfigured bool
languages langs.Languages
doLiveReload bool
- renderStaticToDisk bool
fastRenderMode bool
showErrorInBrowser bool
wasError bool
@@ -369,9 +368,8 @@ func (c *commandeer) loadConfig() error {
}
createMemFs := config.GetBool("renderToMemory")
- c.renderStaticToDisk = config.GetBool("renderStaticToDisk")
- if createMemFs && !c.renderStaticToDisk {
+ if createMemFs {
// Rendering to memoryFS, publish to Root regardless of publishDir.
config.Set("publishDir", "/")
}
@@ -382,14 +380,6 @@ func (c *commandeer) loadConfig() error {
if c.destinationFs != nil {
// Need to reuse the destination on server rebuilds.
fs.Destination = c.destinationFs
- } else if createMemFs && c.renderStaticToDisk {
- // Writes the dynamic output on memory,
- // while serve others directly from publishDir
- publishDir := config.GetString("publishDir")
- writableFs := afero.NewBasePathFs(afero.NewMemMapFs(), publishDir)
- publicFs := afero.NewOsFs()
- fs.Destination = afero.NewCopyOnWriteFs(afero.NewReadOnlyFs(publicFs), writableFs)
- fs.DestinationStatic = publicFs
} else if createMemFs {
// Hugo writes the output to memory instead of the disk.
fs.Destination = new(afero.MemMapFs)
@@ -407,13 +397,11 @@ func (c *commandeer) loadConfig() error {
changeDetector.PrepareNew()
fs.Destination = hugofs.NewHashingFs(fs.Destination, changeDetector)
- fs.DestinationStatic = hugofs.NewHashingFs(fs.DestinationStatic, changeDetector)
c.changeDetector = changeDetector
}
if c.Cfg.GetBool("logPathWarnings") {
fs.Destination = hugofs.NewCreateCountingFs(fs.Destination)
- fs.DestinationStatic = hugofs.NewCreateCountingFs(fs.DestinationStatic)
}
// To debug hard-to-find path issues.