serverAppend bool
serverInterface string
serverPort int
+ liveReloadPort int
serverWatch bool
noHTTPCache bool
)
initHugoBuilderFlags(serverCmd)
serverCmd.Flags().IntVarP(&serverPort, "port", "p", 1313, "port on which the server will listen")
+ serverCmd.Flags().IntVar(&liveReloadPort, "liveReloadPort", -1, "port for live reloading (i.e. 443 in HTTPS proxy situations)")
serverCmd.Flags().StringVarP(&serverInterface, "bind", "", "127.0.0.1", "interface to which the server will bind")
serverCmd.Flags().BoolVarP(&serverWatch, "watch", "w", true, "watch filesystem for changes and recreate as needed")
serverCmd.Flags().BoolVar(&noHTTPCache, "noHTTPCache", false, "prevent HTTP caching")
}
c.Set("port", serverPort)
+ if liveReloadPort != -1 {
+ c.Set("liveReloadPort", liveReloadPort)
+ } else {
+ c.Set("liveReloadPort", serverPort)
+ }
baseURL, err = fixURL(c.Cfg, baseURL)
if err != nil {
}
if s.running() && s.Cfg.GetBool("watch") && !s.Cfg.GetBool("disableLiveReload") {
- transformLinks = append(transformLinks, transform.LiveReloadInject(s.Cfg.GetInt("port")))
+ transformLinks = append(transformLinks, transform.LiveReloadInject(s.Cfg.GetInt("liveReloadPort")))
}
// For performance reasons we only inject the Hugo generator tag on the home page.