hugo/docs/content/overview/usage.md

57 lines
1.7 KiB
Markdown
Raw Normal View History

2013-07-06 23:36:30 +00:00
---
title: "Using Hugo"
2013-08-17 12:34:25 +00:00
date: "2013-07-01"
aliases: ["/doc/usage/"]
---
2013-07-04 15:32:55 +00:00
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/
2013-08-03 07:30:34 +00:00
-D, --build-drafts=false: include content marked as draft
--config="": config file (default is path/config.yaml|json|toml)
2013-08-03 07:30:34 +00:00
-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: if true, 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
2013-07-04 15:32:55 +00:00
## Common Usage Example:
2013-08-03 07:30:34 +00:00
The most common use is probably to run hugo with your current
2013-07-04 15:32:55 +00:00
directory being the input directory.
$ hugo
> X pages created
> Y indexes created
2013-08-03 07:30:34 +00:00
in 8 ms
2013-07-04 15:32:55 +00:00
2013-08-03 07:30:34 +00: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 15:32:55 +00:00
your browser to view the changes.**
$ hugo -s ~/mysite --watch
2013-07-04 15:32:55 +00:00
Watching for changes. Press ctrl+c to stop
15 pages created
0 tags created
2013-08-03 07:30:34 +00:00
in 8 ms
2013-07-04 15:32:55 +00:00
Hugo can even run a server and create your site at the same time!
$hugo --server -ws ~/mysite
2013-07-04 15:32:55 +00:00
Watching for changes. Press ctrl+c to stop
15 pages created
0 tags created
2013-08-03 07:30:34 +00:00
in 8 ms
2013-07-04 15:32:55 +00:00
Web Server is available at http://localhost:1313
Press ctrl+c to stop