|
| 1 | +--- |
| 2 | +title: "hugo build" |
| 3 | +slug: hugo_build |
| 4 | +url: /commands/hugo_build/ |
| 5 | +--- |
| 6 | +## hugo build |
| 7 | + |
| 8 | +build builds your site |
| 9 | + |
| 10 | +### Synopsis |
| 11 | + |
| 12 | +build is the main command, used to build your Hugo site. |
| 13 | + |
| 14 | +Hugo is a Fast and Flexible Static Site Generator |
| 15 | +built with love by spf13 and friends in Go. |
| 16 | + |
| 17 | +Complete documentation is available at https://gohugo.io/. |
| 18 | + |
| 19 | +``` |
| 20 | +hugo build [flags] |
| 21 | +``` |
| 22 | + |
| 23 | +### Options |
| 24 | + |
| 25 | +``` |
| 26 | + -b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/ |
| 27 | + -D, --buildDrafts include content marked as draft |
| 28 | + -E, --buildExpired include expired content |
| 29 | + -F, --buildFuture include content with publishdate in the future |
| 30 | + --cacheDir string filesystem path to cache directory |
| 31 | + --cleanDestinationDir remove files from destination not found in static directories |
| 32 | + --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 |
| 33 | + --config string config file (default is hugo.yaml|json|toml) |
| 34 | + --configDir string config dir (default "config") |
| 35 | + -c, --contentDir string filesystem path to content directory |
| 36 | + --debug debug output |
| 37 | + -d, --destination string filesystem path to write files to |
| 38 | + --disableKinds strings disable different kind of pages (home, RSS etc.) |
| 39 | + --enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages |
| 40 | + -e, --environment string build environment |
| 41 | + --forceSyncStatic copy all files when static is changed. |
| 42 | + --gc enable to run some cleanup tasks (remove unused cache files) after the build |
| 43 | + -h, --help help for build |
| 44 | + --ignoreCache ignores the cache directory |
| 45 | + --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern |
| 46 | + -l, --layoutDir string filesystem path to layout directory |
| 47 | + --logLevel string log level (debug|info|warn|error) |
| 48 | + --minify minify any supported output format (HTML, XML etc.) |
| 49 | + --noBuildLock don't create .hugo_build.lock file |
| 50 | + --noChmod don't sync permission mode of files |
| 51 | + --noTimes don't sync modification time of files |
| 52 | + --panicOnWarning panic on first WARNING log |
| 53 | + --poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes |
| 54 | + --printI18nWarnings print missing translations |
| 55 | + --printMemoryUsage print memory usage to screen at intervals |
| 56 | + --printPathWarnings print warnings on duplicate target paths etc. |
| 57 | + --printUnusedTemplates print warnings on unused templates. |
| 58 | + --quiet build in quiet mode |
| 59 | + --renderSegments strings named segments to render (configured in the segments config) |
| 60 | + -M, --renderToMemory render to memory (mostly useful when running the server) |
| 61 | + -s, --source string filesystem path to read files relative from |
| 62 | + --templateMetrics display metrics about template executions |
| 63 | + --templateMetricsHints calculate some improvement hints when combined with --templateMetrics |
| 64 | + -t, --theme strings themes to use (located in /themes/THEMENAME/) |
| 65 | + --themesDir string filesystem path to themes directory |
| 66 | + --trace file write trace to file (not useful in general) |
| 67 | + -v, --verbose verbose output |
| 68 | + -w, --watch watch filesystem for changes and recreate as needed |
| 69 | +``` |
| 70 | + |
| 71 | +### SEE ALSO |
| 72 | + |
| 73 | +* [hugo](/commands/hugo/) - hugo builds your site |
| 74 | + |
0 commit comments