--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.
- --format string preferred file format (toml, yaml or json) (default "toml")
--gc enable to run some cleanup tasks (remove unused cache files) after the build
-h, --help help for hugo
--ignoreCache ignores the cache directory
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
### Options
```
- -h, --help help for config
+ -b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
+ --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
+ -c, --contentDir string filesystem path to content directory
+ --format string preferred file format (toml, yaml or json) (default "toml")
+ -h, --help help for config
+ -t, --theme strings themes to use (located in /themes/THEMENAME/)
```
### Options inherited from parent commands
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
### Options
```
- -h, --help help for mounts
+ -b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
+ --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
+ -c, --contentDir string filesystem path to content directory
+ -h, --help help for mounts
+ -t, --theme strings themes to use (located in /themes/THEMENAME/)
```
### Options inherited from parent commands
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
### Options
```
- --all clean entire module cache
- -h, --help help for clean
- --pattern string pattern matching module paths to clean (all if not set), e.g. "**hugo*"
+ --all clean entire module cache
+ -b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
+ --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
+ -c, --contentDir string filesystem path to content directory
+ -h, --help help for clean
+ --pattern string pattern matching module paths to clean (all if not set), e.g. "**hugo*"
+ -t, --theme strings themes to use (located in /themes/THEMENAME/)
```
### Options inherited from parent commands
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
### Options
```
- --clean delete module cache for dependencies that fail verification
- -h, --help help for graph
+ -b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
+ --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
+ --clean delete module cache for dependencies that fail verification
+ -c, --contentDir string filesystem path to content directory
+ -h, --help help for graph
+ -t, --theme strings themes to use (located in /themes/THEMENAME/)
```
### Options inherited from parent commands
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
### Options
```
- -h, --help help for init
+ -b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
+ --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
+ -c, --contentDir string filesystem path to content directory
+ -h, --help help for init
+ -t, --theme strings themes to use (located in /themes/THEMENAME/)
```
### Options inherited from parent commands
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
### Options
```
- -h, --help help for pack
+ -b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
+ --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
+ -c, --contentDir string filesystem path to content directory
+ -h, --help help for pack
+ -t, --theme strings themes to use (located in /themes/THEMENAME/)
```
### Options inherited from parent commands
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
### Options
```
- -h, --help help for tidy
+ -b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
+ --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
+ -c, --contentDir string filesystem path to content directory
+ -h, --help help for tidy
+ -t, --theme strings themes to use (located in /themes/THEMENAME/)
```
### Options inherited from parent commands
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
### Options
```
- -h, --help help for vendor
+ -b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
+ --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
+ -c, --contentDir string filesystem path to content directory
+ -h, --help help for vendor
+ -t, --theme strings themes to use (located in /themes/THEMENAME/)
```
### Options inherited from parent commands
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
### Options
```
- --clean delete module cache for dependencies that fail verification
- -h, --help help for verify
+ -b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
+ --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
+ --clean delete module cache for dependencies that fail verification
+ -c, --contentDir string filesystem path to content directory
+ -h, --help help for verify
+ -t, --theme strings themes to use (located in /themes/THEMENAME/)
```
### Options inherited from parent commands
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
### Options
```
- --editor string edit new content with this editor, if provided
- -f, --force overwrite file if it already exists
- -h, --help help for content
- -k, --kind string content type to create
+ -b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
+ --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
+ -c, --contentDir string filesystem path to content directory
+ --editor string edit new content with this editor, if provided
+ -f, --force overwrite file if it already exists
+ --format string preferred file format (toml, yaml or json) (default "toml")
+ -h, --help help for content
+ -k, --kind string content type to create
+ -t, --theme strings themes to use (located in /themes/THEMENAME/)
```
### Options inherited from parent commands
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
### Options
```
- --force init inside non-empty directory
+ -f, --force init inside non-empty directory
-h, --help help for site
```
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
--debug debug output
-d, --destination string filesystem path to write files to
-e, --environment string build environment
- --format string preferred file format (toml, yaml or json) (default "toml")
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
--log enable Logging
--logFile string log File path (if set, logging enabled automatically)
useResourceCacheWhen="fallback"
writeStats = false
noJSConfigInAssets = false
+ [[build.cachebusters]]
+ source = "assets/watching/hugo_stats\\.json"
+ target = "styles\\.css"
+ [[build.cachebusters]]
+ source = "(postcss|tailwind)\\.config\\.js"
+ target = "css"
+ [[build.cachebusters]]
+ source = "assets/.*\\.(js|ts|jsx|tsx)"
+ target = "js"
+ [[build.cachebusters]]
+ source = "assets/.*\\.(.*)$"
+ target = "$1"
{{< /code-toggle >}}
noJSConfigInAssets
: Turn off writing a `jsconfig.json` into your `/assets` folder with mapping of imports from running [js.Build](https://gohugo.io/hugo-pipes/js). This file is intended to help with intellisense/navigation inside code editors such as [VS Code](https://code.visualstudio.com/). Note that if you do not use `js.Build`, no file will be written.
+cachebusters
+: See [Configure Cache Busters](#configure-cache-busters)
+
+## Configure Cache Busters
+
+{{< new-in "0.112.0" >}}
+
+The `build.cachebusters` configuration option was added to support development using Tailwind 3.x's JIT compiler where a `build` config may look like this:
+
+{{< code-toggle file="hugo" >}}
+[build]
+writeStats = true
+ [[build.cachebusters]]
+ source = "assets/watching/hugo_stats\\.json"
+ target = "styles\\.css"
+ [[build.cachebusters]]
+ source = "(postcss|tailwind)\\.config\\.js"
+ target = "css"
+ [[build.cachebusters]]
+ source = "assets/.*\\.(js|ts|jsx|tsx)"
+ target = "js"
+ [[build.cachebusters]]
+ source = "assets/.*\\.(.*)$"
+ target = "$1"
+{{< /code-toggle >}}
+
+Some key points in the above are `writeStats = true`, which writes a `hugo_stats.json` file on each build with HTML classes etc. that's used in the rendered output. Changes to this file will trigger a rebuild of the `styles.css` file. You also need to add `hugo_stats.json` to Hugo's server watcher. See [Hugo Starter Tailwind Basic](https://github.com/bep/hugo-starter-tailwind-basic) for a running example.
+
+source
+: A regexp matching file(s) relative to one of the virtual component directories in Hugo, typically `assets/...`.
+
+target
+: A regexp matching the keys in the resource cache that should be expired when `source` changes. You can use the matching regexp groups from `source` in the expression, e.g. `$1`.
+
## Configure Server
This is only relevant when running `hugo server`, and it allows to set HTTP headers during development, which allows you to test out your Content Security Policy and similar. The configuration format matches [Netlify's](https://docs.netlify.com/routing/headers/#syntax-for-the-netlify-configuration-file) with slightly more powerful [Glob matching](https://github.com/gobwas/glob):
To build Hugo from source you must:
1. Install [Git]
-1. Install [Go] version 1.18 or later
+1. Install [Go] version 1.19 or later
1. Update your PATH environment variable as described in the [Go documentation]
> The install directory is controlled by the GOPATH and GOBIN environment variables. If GOBIN is set, binaries are installed to that directory. If GOPATH is set, binaries are installed to the bin subdirectory of the first directory in the GOPATH list. Otherwise, binaries are installed to the bin subdirectory of the default GOPATH ($HOME/go or %USERPROFILE%\go).
command = "hugo --gc --minify"
[context.production.environment]
-HUGO_VERSION = "0.112.3"
+HUGO_VERSION = "0.112.5"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
command = "hugo --gc --minify --enableGitInfo"
[context.split1.environment]
-HUGO_VERSION = "0.112.3"
+HUGO_VERSION = "0.112.5"
HUGO_ENV = "production"
[context.deploy-preview]
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
[context.deploy-preview.environment]
-HUGO_VERSION = "0.112.3"
+HUGO_VERSION = "0.112.5"
[context.branch-deploy]
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
[context.branch-deploy.environment]
-HUGO_VERSION = "0.112.3"
+HUGO_VERSION = "0.112.5"
[context.next.environment]
HUGO_ENABLEGITINFO = "true"