Some minor adjustments to the new static filesystem logic
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 8 Mar 2022 16:43:48 +0000 (17:43 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 8 Mar 2022 18:27:54 +0000 (19:27 +0100)
Closes #9625

commands/commandeer.go
commands/server.go

index 07181f2447a15877ddb18ed0a1d2118e3d8f83f6..7525bf18468f739942e396e9c13d012469bcda30 100644 (file)
@@ -412,8 +412,9 @@ func (c *commandeer) loadConfig() error {
                }
 
                if c.Cfg.GetBool("logPathWarnings") {
+                       // Note that we only care about the "dynamic creates" here,
+                       // so skip the static fs.
                        fs.Destination = hugofs.NewCreateCountingFs(fs.Destination)
-                       fs.DestinationStatic = hugofs.NewCreateCountingFs(fs.DestinationStatic)
                }
 
                // To debug hard-to-find path issues.
index 3f52908167293ce036971db27774c45dd2cf699f..485f23388996820775638ead394b056fbdada9cc 100644 (file)
@@ -99,10 +99,10 @@ of a second, you will be able to save and see your changes nearly instantly.`,
        cc.cmd.Flags().BoolVarP(&cc.serverAppend, "appendPort", "", true, "append port to baseURL")
        cc.cmd.Flags().BoolVar(&cc.disableLiveReload, "disableLiveReload", false, "watch without enabling live browser reload on rebuild")
        cc.cmd.Flags().BoolVar(&cc.navigateToChanged, "navigateToChanged", false, "navigate to changed content file on live browser reload")
-       cc.cmd.Flags().BoolVar(&cc.renderToDisk, "renderToDisk", false, "render to Destination path (default is render to memory & serve from there)")
+       cc.cmd.Flags().BoolVar(&cc.renderToDisk, "renderToDisk", false, "serve all files from disk (default is from memory)")
+       cc.cmd.Flags().BoolVar(&cc.renderStaticToDisk, "renderStaticToDisk", false, "serve static files from disk and dynamic files from memory")
        cc.cmd.Flags().BoolVar(&cc.disableFastRender, "disableFastRender", false, "enables full re-renders on changes")
        cc.cmd.Flags().BoolVar(&cc.disableBrowserError, "disableBrowserError", false, "do not show build errors in the browser")
-       cc.cmd.Flags().BoolVar(&cc.renderStaticToDisk, "renderStaticToDisk", false, "render static files to disk but dynamic files render to memory.")
 
        cc.cmd.Flags().String("memstats", "", "log memory usage to this file")
        cc.cmd.Flags().String("meminterval", "100ms", "interval to poll memory usage (requires --memstats), valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".")