diff --git a/docs/content/extras/livereload.md b/docs/content/extras/livereload.md index 602b9124c..a69e7af92 100644 --- a/docs/content/extras/livereload.md +++ b/docs/content/extras/livereload.md @@ -1,5 +1,5 @@ --- -lastmod: 2015-04-01 +lastmod: 2016-08-09 date: 2014-05-26 menu: main: @@ -23,7 +23,8 @@ Hugo comes with LiveReload built in. There are no additional packages to install. A common way to use Hugo while developing a site is to have Hugo run a server and watch for changes: - $ hugo server --watch +{{< nohighlight >}}$ hugo server +{{< /nohighlight >}} This will run a full functioning web server while simultaneously watching your file system for additions, deletions or changes within @@ -34,32 +35,41 @@ your: * data files * layouts * current theme + * configuration files -Whenever anything changes Hugo will rebuild the site, continue to serve -the content and as soon as the build is finished it will tell the -browser and silently reload the page. Because most hugo builds are so +Whenever anything changes, Hugo will rebuild the site while continuing to serve +the content. As soon as the build is finished, it will tell the +browser and silently reload the page. Because most Hugo builds are so fast they are barely noticeable, you merely need to glance at your open -browser and you will see the change already there. +browser and you will see the change, already there. This means that keeping the site open on a second monitor (or another half of your current monitor) allows you to see exactly what your -content looks like without even leaving your text editor. +content looks like, without even leaving your text editor. + +## Disabling Watch + +If for some reason you don't want the Hugo server's watch functionality, +just do: + +{{< nohighlight >}}$ hugo server --watch=false +{{< /nohighlight >}} ## Disabling LiveReload -LiveReload works by injecting JavaScript into the pages it -creates that creates a web socket client to the hugo web socket server. +LiveReload works by injecting JavaScript into the pages Hugo generates, +which creates a connection from the browser web socket client to the +Hugo web socket server. Awesome for development, but not something you would want to do in -production. Since many people use `hugo server --watch` in production to +production. Since many people use `hugo server` in production to instantly display any updated content, we’ve made it easy to disable the -LiveReload functionality. +LiveReload functionality: - $ hugo server --watch --disableLiveReload +{{< nohighlight >}}$ hugo server --disableLiveReload +{{< /nohighlight >}} ## Notes -The `--watch` flag is enabled by default when `hugo server` is run. - You must have a closing `` tag for LiveReload to work. Hugo injects the LiveReload `