2013-07-06 19:36:30 -04:00
|
|
|
---
|
|
|
|
title: "Using Hugo"
|
2013-08-17 08:34:25 -04:00
|
|
|
date: "2013-07-01"
|
|
|
|
aliases: ["/doc/usage/"]
|
2013-10-25 18:42:46 -04:00
|
|
|
groups: ['gettingStarted']
|
|
|
|
groups_weight: 30
|
2014-01-28 23:29:05 -05:00
|
|
|
notoc: true
|
2013-07-08 17:57:01 -04:00
|
|
|
---
|
2013-07-04 11:32:55 -04:00
|
|
|
|
|
|
|
Make sure either hugo is in your path or provide a path to it.
|
|
|
|
|
2013-09-30 22:39:06 -04:00
|
|
|
$ hugo help
|
|
|
|
A Fast and Flexible Static Site Generator
|
|
|
|
built with love by spf13 and friends in Go.
|
|
|
|
|
|
|
|
Complete documentation is available at http://hugo.spf13.com
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
hugo [flags]
|
|
|
|
hugo [command]
|
|
|
|
|
|
|
|
Available Commands:
|
|
|
|
server :: Hugo runs it's own a webserver to render the files
|
|
|
|
version :: Print the version number of Hugo
|
|
|
|
check :: Check content in the source directory
|
|
|
|
benchmark :: Benchmark hugo by building a site a number of times
|
|
|
|
help [command] :: Help about any command
|
|
|
|
|
|
|
|
Available Flags:
|
2013-07-19 03:38:24 -04:00
|
|
|
-b, --base-url="": hostname (and path) to the root eg. http://spf13.com/
|
2013-08-03 03:30:34 -04:00
|
|
|
-D, --build-drafts=false: include content marked as draft
|
2013-07-19 03:38:24 -04:00
|
|
|
--config="": config file (default is path/config.yaml|json|toml)
|
2013-08-03 03:30:34 -04:00
|
|
|
-d, --destination="": filesystem path to write files to
|
2013-07-19 03:38:24 -04:00
|
|
|
-s, --source="": filesystem path to read files relative from
|
2013-08-14 04:53:41 -04:00
|
|
|
--uglyurls=false: if true, use /filename.html instead of /filename/
|
2013-07-19 03:38:24 -04:00
|
|
|
-v, --verbose=false: verbose output
|
|
|
|
-w, --watch=false: watch filesystem for changes and recreate as needed
|
2013-07-04 11:32:55 -04:00
|
|
|
|
2013-09-30 22:39:06 -04:00
|
|
|
Use "hugo help [command]" for more information about that command.
|
|
|
|
|
2013-07-04 11:32:55 -04:00
|
|
|
## Common Usage Example:
|
|
|
|
|
2013-08-03 03:30:34 -04:00
|
|
|
The most common use is probably to run hugo with your current
|
2013-07-04 11:32:55 -04:00
|
|
|
directory being the input directory.
|
|
|
|
|
|
|
|
|
|
|
|
$ hugo
|
|
|
|
> X pages created
|
2013-07-05 00:35:11 -04:00
|
|
|
> Y indexes created
|
2013-08-03 03:30:34 -04:00
|
|
|
in 8 ms
|
2013-07-04 11:32:55 -04:00
|
|
|
|
|
|
|
|
2013-08-03 03:30:34 -04:00
|
|
|
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
|
2013-07-04 11:32:55 -04:00
|
|
|
your browser to view the changes.**
|
|
|
|
|
2013-08-05 09:45:01 -04:00
|
|
|
$ hugo -s ~/mysite --watch
|
2013-09-30 22:39:06 -04:00
|
|
|
28 pages created
|
|
|
|
0 tags index created
|
|
|
|
in 38 ms
|
|
|
|
Watching for changes in /Users/spf13/Code/hugo/docs/content
|
|
|
|
Press ctrl+c to stop
|
2013-07-04 11:32:55 -04:00
|
|
|
|
|
|
|
Hugo can even run a server and create your site at the same time!
|
|
|
|
|
2013-09-30 22:39:06 -04:00
|
|
|
$ hugo server -ws ~/mysite
|
|
|
|
Watching for changes in /Users/spf13/Code/hugo/docs/content
|
2013-07-04 11:32:55 -04:00
|
|
|
Web Server is available at http://localhost:1313
|
|
|
|
Press ctrl+c to stop
|
2013-09-30 22:39:06 -04:00
|
|
|
28 pages created
|
|
|
|
0 tags created
|
|
|
|
in 28 ms
|
2013-07-04 11:32:55 -04:00
|
|
|
|