mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-28 00:10:47 +00:00
f31ec3c280
The pflag package used in hugo has to use the "=" sign for double dash options such as --source. Thus the original example `--source ~/mysite` is already incorrect. Adding the = sign though woul not fix things in this case, since `--source=~/mysite` does not get resolved to /home/username/mysite, but looks for the ./~/mysite directory within the current directory. To resolve this, either the directory name has to be changed in the docs not to use the "~" sign, or have to change to use the single dash version of the command line flag. The latter seems to be more in line with the rest of the example. Leaving `--watch` as a double dash option to minimize the change, though it could be either way, since the follow up example uses the single dash version of both.
1.7 KiB
1.7 KiB
title | Pubdate |
---|---|
Using Hugo | 2013-07-01 |
Make sure either hugo is in your path or provide a path to it.
$ hugo --help
usage: hugo [flags] []
-b, --base-url="": hostname (and path) to the root eg. http://spf13.com/
-D, --build-drafts=false: include content marked as draft
--config="": config file (default is path/config.yaml|json|toml)
-d, --destination="": filesystem path to write files to
-h, --help=false: show this help
--port="1313": port to run web server on, default :1313
-S, --server=false: run a (very) simple web server
-s, --source="": filesystem path to read files relative from
--uglyurls=false: use /filename.html instead of /filename/
-v, --verbose=false: verbose output
--version=false: which version of hugo
-w, --watch=false: watch filesystem for changes and recreate as needed
Common Usage Example:
The most common use is probably to run hugo with your current directory being the input directory.
$ hugo
> X pages created
> Y indexes created
in 8 ms
If you are working on things and want to see the changes immediately, tell Hugo to watch for changes. It will recreate the site faster than you can tab over to your browser to view the changes.
$ hugo -s ~/mysite --watch
Watching for changes. Press ctrl+c to stop
15 pages created
0 tags created
in 8 ms
Hugo can even run a server and create your site at the same time!
$hugo --server -ws ~/mysite
Watching for changes. Press ctrl+c to stop
15 pages created
0 tags created
in 8 ms
Web Server is available at http://localhost:1313
Press ctrl+c to stop