Hugo server watch by default

This commit is contained in:
Steve Francia 2015-11-20 10:13:03 -05:00
parent 35abd179e2
commit 97d0689580
2 changed files with 6 additions and 3 deletions

View file

@ -53,8 +53,10 @@ and use a more full featured server such as Nginx or Caddy.
'hugo server' will avoid writing the rendered and served content to disk,
preferring to store it in memory.
Often server is paired with '--watch' which Hugo will look for changes to the source and
continously rebuild and serve the website.`,
By default hugo will also watch your files for any changes you make and
automatically rebuild the site. It will then live reload any open browser pages
and push the latest content to them. As most hugo sites are built in a fraction
of a second you will be able to save and see your changes nearly instantly.`,
//Run: server,
}
@ -81,7 +83,7 @@ func (f noDirFile) Readdir(count int) ([]os.FileInfo, error) {
func init() {
serverCmd.Flags().IntVarP(&serverPort, "port", "p", 1313, "port on which the server will listen")
serverCmd.Flags().StringVarP(&serverInterface, "bind", "", "127.0.0.1", "interface to which the server will bind")
serverCmd.Flags().BoolVarP(&serverWatch, "watch", "w", false, "watch filesystem for changes and recreate as needed")
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(&renderToDisk, "renderToDisk", false, "render to Destination path (default is render to memory & serve from there)")

View file

@ -12,6 +12,7 @@ weight: 10
## **0.15.0** ???
* `hugo server` now builds ~30%+ faster by rendering to memory instead of disk
* `hugo server` will watch by default now.
* Have Jekyll site, but dreaming of porting it to Hugo? This release introduces a new `hugo import jekyll`command that makes this easier than ever. [1469](https://github.com/spf13/hugo/pull/1469)
* We now use a custom-built `LazyFileReader` for reading file contents, which means we don't read media files in `/content` into memory anymore -- and file reading is now performed in parallel on multicore PCs. [1181](https://github.com/spf13/hugo/issues/1181)
* Hugo is now built with `Go 1.5` which, among many other improvements, have fixed the last known data race in Hugo. [917] (https://github.com/spf13/hugo/issues/917)