$ hugo help hugo is the main command, used to build your Hugo site. Hugo is a Fast and Flexible Static Site Generator built with love by spf13 and friends in Go. Complete documentation is available at http://gohugo.io/. Usage: hugo [flags] hugo [command] Available Commands: completion Generate the autocompletion script for the specified shell config Print the site configuration convert Convert your content to different formats deploy Deploy your site to a Cloud provider. env Print Hugo version and environment info gen A collection of several useful generators. help Help about any command import Import your site from others. list Listing out various types of content mod Various Hugo Modules helpers. new Create new content for your site server A high performance webserver version Print the version number of Hugo Flags: -b, --baseURL string hostname (and path) to the root, e.g. http://spf13.com/ -D, --buildDrafts include content marked as draft -E, --buildExpired include expired content -F, --buildFuture include content with publishdate in the future --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/ --cleanDestinationDir remove files from destination not found in static directories --config string config file (default is path/config.yaml|json|toml) --configDir string config dir (default "config") -c, --contentDir string filesystem path to content directory --debug debug output -d, --destination string filesystem path to write files to --disableKinds strings disable different kind of pages (home, RSS etc.) --enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages -e, --environment string build environment --forceSyncStatic copy all files when static is changed. --gc enable to run some cleanup tasks (remove unused cache files) after the build -h, --help help for hugo --ignoreCache ignores the cache directory --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern -l, --layoutDir string filesystem path to layout directory --log enable Logging --logFile string log File path (if set, logging enabled automatically) --minify minify any supported output format (HTML, XML etc.) --noChmod don't sync permission mode of files --noTimes don't sync modification time of files --panicOnWarning panic on first WARNING log --poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes --printI18nWarnings print missing translations --printMemoryUsage print memory usage to screen at intervals --printPathWarnings print warnings on duplicate target paths etc. --printUnusedTemplates print warnings on unused templates. --quiet build in quiet mode --renderToMemory render to memory (only useful for benchmark testing) -s, --source string filesystem path to read files relative from --templateMetrics display metrics about template executions --templateMetricsHints calculate some improvement hints when combined with --templateMetrics -t, --theme strings themes to use (located in /themes/THEMENAME/) --themesDir string filesystem path to themes directory --trace file write trace to file (not useful in general) -v, --verbose verbose output --verboseLog verbose logging -w, --watch watch filesystem for changes and recreate as needed Use "hugo [command] --help" for more information about a command.
Create a new post
$ hugo new post/hello-world.md
$ hugo server -D
Build static pages
$ hugo -D # force clean public folder $ hugo -F --cleanDestinationDir
Deploy to remote sites
For more information, you can refer to the Hugo’s official documentation-deployment section.
Frequently Asked Questions (FAQ)
Solutions to some common Hugo problems.
Note: The answers/solutions presented below are short, and may not be enough to solve your problem. Visit Hugo Discourse and use the search. It that does not help, start a new topic and ask your questions.
I can’t see my content!
Can I set configuration variables via OS environment?
Yes you can! See Configure with Environment Variables.
How do I schedule posts?
publishDatein the page Front Matter to a datetime in the future. If you want the creation and publication datetime to be the same, it’s also sufficient to only set
- Build and publish at intervals.
How to automate the “publish at intervals” part depends on your situation:
- If you deploy from your own PC/server, you can automate with Cron or similar.
- If your site is hosted on a service similar to Netlify you can use a service such as ifttt to schedule the updates.
Can I use the latest Hugo version on Netlify?
Yes you can! Read this.
I get “TOCSS … this feature is not available in your current Hugo version”
If you process
CSS in your Hugo project, you need the Hugo
extended version, or else you may see this error message:
error: failed to transform resource: TOCSS: failed to transform "scss/main.scss" (text/x-scss): this feature is not available in your current Hugo version
We release two set of binaries for technical reasons. The extended version is not what you get by default for some installation methods. On the release page, look for archives with
extended in the name. To build
go install --tags extended
To confirm, run
hugo version and look for the word