diff options
Diffstat (limited to 'commands/server.go')
-rw-r--r-- | commands/server.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/commands/server.go b/commands/server.go index 32a94f9c8..89d5c239e 100644 --- a/commands/server.go +++ b/commands/server.go @@ -33,6 +33,7 @@ import ( var ( disableLiveReload bool + navigateToChanged bool renderToDisk bool serverAppend bool serverInterface string @@ -87,6 +88,7 @@ func init() { serverCmd.Flags().BoolVarP(&serverWatch, "watch", "w", true, "watch filesystem for changes and recreate as needed") serverCmd.Flags().BoolVarP(&serverAppend, "appendPort", "", true, "append port to baseURL") serverCmd.Flags().BoolVar(&disableLiveReload, "disableLiveReload", false, "watch without enabling live browser reload on rebuild") + serverCmd.Flags().BoolVar(&navigateToChanged, "navigateToChanged", false, "navigate to changed content file on live browser reload") serverCmd.Flags().BoolVar(&renderToDisk, "renderToDisk", false, "render to Destination path (default is render to memory & serve from there)") serverCmd.Flags().String("memstats", "", "log memory usage to this file") serverCmd.Flags().String("meminterval", "100ms", "interval to poll memory usage (requires --memstats), valid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".") @@ -110,6 +112,10 @@ func server(cmd *cobra.Command, args []string) error { c.Set("disableLiveReload", disableLiveReload) } + if cmd.Flags().Changed("navigateToChanged") { + c.Set("navigateToChanged", navigateToChanged) + } + if serverWatch { c.Set("watch", true) } |