2013-07-06 19:36:30 -04:00
|
|
|
---
|
2014-05-29 18:42:05 -04:00
|
|
|
aliases:
|
|
|
|
- /doc/usage/
|
|
|
|
date: 2013-07-01
|
2014-04-23 03:00:11 -04:00
|
|
|
menu:
|
|
|
|
main:
|
2014-05-29 18:42:05 -04:00
|
|
|
parent: getting started
|
|
|
|
next: /overview/configuration
|
|
|
|
notoc: true
|
|
|
|
prev: /overview/installing
|
|
|
|
title: Using Hugo
|
|
|
|
weight: 30
|
2013-07-08 17:57:01 -04:00
|
|
|
---
|
2013-07-04 11:32:55 -04:00
|
|
|
|
2015-01-09 13:51:15 -05:00
|
|
|
Make sure either `hugo` is in your `PATH` or provide a path to it.
|
2014-05-27 18:32:57 -04:00
|
|
|
|
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.
|
|
|
|
|
2014-09-27 03:35:42 -04:00
|
|
|
Complete documentation is available at http://gohugo.io
|
2013-09-30 22:39:06 -04:00
|
|
|
|
|
|
|
Usage:
|
|
|
|
hugo [flags]
|
|
|
|
hugo [command]
|
|
|
|
|
|
|
|
Available Commands:
|
2014-10-07 19:52:58 -04:00
|
|
|
server Hugo runs its own 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
|
|
|
|
new [path] Create new content for your site
|
|
|
|
help [command] Help about any command
|
2013-09-30 22:39:06 -04:00
|
|
|
|
|
|
|
Available Flags:
|
2014-05-27 18:32:57 -04:00
|
|
|
-b, --baseUrl="": hostname (and path) to the root eg. http://spf13.com/
|
2014-05-29 01:00:06 -04:00
|
|
|
-D, --buildDrafts=false: build content marked as draft
|
|
|
|
-F, --buildFuture=false: build content with PublishDate in the future
|
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
|
2014-05-27 18:32:57 -04:00
|
|
|
--disableRSS=false: Do not build RSS files
|
|
|
|
--disableSitemap=false: Do not build Sitemap file
|
2014-03-31 13:23:34 -04:00
|
|
|
--log=false: Enable Logging
|
2014-05-27 18:32:57 -04:00
|
|
|
--logFile="": Log File path (if set, logging enabled automatically)
|
2013-07-19 03:38:24 -04:00
|
|
|
-s, --source="": filesystem path to read files relative from
|
2014-05-27 18:32:57 -04:00
|
|
|
--stepAnalysis=false: display memory and timing of different steps of the program
|
|
|
|
-t, --theme="": theme to use (located in /themes/THEMENAME/)
|
|
|
|
--uglyUrls=false: if true, use /filename.html instead of /filename/
|
2013-07-19 03:38:24 -04:00
|
|
|
-v, --verbose=false: verbose output
|
2014-05-27 18:32:57 -04:00
|
|
|
--verboseLog=false: verbose logging
|
2013-07-19 03:38:24 -04:00
|
|
|
-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.
|
|
|
|
|
2014-09-03 00:12:26 -04:00
|
|
|
## Common Usage Example
|
2013-07-04 11:32:55 -04:00
|
|
|
|
2015-01-09 13:51:15 -05: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-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
|
2014-05-27 18:32:57 -04:00
|
|
|
immediately, tell Hugo to watch for changes.
|
|
|
|
|
|
|
|
Hugo will watch the filesystem for changes, rebuild your site as soon as a file
|
|
|
|
is saved.
|
2013-07-04 11:32:55 -04:00
|
|
|
|
2013-08-05 09:45:01 -04:00
|
|
|
$ hugo -s ~/mysite --watch
|
2013-09-30 22:39:06 -04:00
|
|
|
28 pages created
|
2014-05-15 09:58:55 -04:00
|
|
|
in 18 ms
|
2013-09-30 22:39:06 -04:00
|
|
|
Watching for changes in /Users/spf13/Code/hugo/docs/content
|
|
|
|
Press ctrl+c to stop
|
2013-07-04 11:32:55 -04:00
|
|
|
|
2014-05-27 18:32:57 -04:00
|
|
|
Hugo can even run a server and create your site at the same time! Hugo
|
2015-01-09 13:51:15 -05:00
|
|
|
implements [LiveReload](/extras/livereload) technology to automatically reload any open pages in
|
2014-05-27 18:32:57 -04:00
|
|
|
all browsers (including mobile).
|
2013-07-04 11:32:55 -04:00
|
|
|
|
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
|
2014-05-15 09:58:55 -04:00
|
|
|
in 18 ms
|
2013-07-04 11:32:55 -04:00
|
|
|
|