mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Merge commit 'd3927310d5b2404c3238f9b899db3329ea516490'
This commit is contained in:
commit
a838a27e4c
75 changed files with 214 additions and 167 deletions
|
@ -3,6 +3,3 @@
|
||||||
X-XSS-Protection: 1; mode=block
|
X-XSS-Protection: 1; mode=block
|
||||||
X-Content-Type-Options: nosniff
|
X-Content-Type-Options: nosniff
|
||||||
Referrer-Policy: origin-when-cross-origin
|
Referrer-Policy: origin-when-cross-origin
|
||||||
/*
|
|
||||||
Link: <{{ "dist/app.bundle.js" | relURL }}>; rel=preload; as=script
|
|
||||||
Link: <{{ "dist/main.css" | relURL }}>; rel=preload; as=style
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
# github.com/gohugoio/gohugoioTheme v0.0.0-20230418063032-99f9185b8e11
|
# github.com/gohugoio/gohugoioTheme v0.0.0-20230527124826-78bc315d7b8a
|
||||||
|
|
|
@ -27,9 +27,9 @@ toc: true
|
||||||
|
|
||||||
## All Privacy Settings
|
## All Privacy Settings
|
||||||
|
|
||||||
Below are all privacy settings and their default value. These settings need to be put in your site config (e.g. `config.toml`).
|
Below are all privacy settings and their default value. These settings need to be put in your site config (e.g. `hugo.toml`).
|
||||||
|
|
||||||
{{< code-toggle file="config">}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[privacy]
|
[privacy]
|
||||||
[privacy.disqus]
|
[privacy.disqus]
|
||||||
disable = false
|
disable = false
|
||||||
|
@ -58,7 +58,7 @@ privacyEnhanced = false
|
||||||
|
|
||||||
An example Privacy Config that disables all the relevant services in Hugo. With this configuration, the other settings will not matter.
|
An example Privacy Config that disables all the relevant services in Hugo. With this configuration, the other settings will not matter.
|
||||||
|
|
||||||
{{< code-toggle file="config">}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[privacy]
|
[privacy]
|
||||||
[privacy.disqus]
|
[privacy.disqus]
|
||||||
disable = true
|
disable = true
|
||||||
|
@ -98,7 +98,7 @@ simple
|
||||||
|
|
||||||
**Note:** If you use the _simple mode_ for Instagram and a site styled with Bootstrap 4, you may want to disable the inline styles provided by Hugo:
|
**Note:** If you use the _simple mode_ for Instagram and a site styled with Bootstrap 4, you may want to disable the inline styles provided by Hugo:
|
||||||
|
|
||||||
{{< code-toggle file="config">}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[services]
|
[services]
|
||||||
[services.instagram]
|
[services.instagram]
|
||||||
disableInlineCSS = true
|
disableInlineCSS = true
|
||||||
|
@ -114,7 +114,7 @@ simple
|
||||||
|
|
||||||
**Note:** If you use the _simple mode_ for Twitter, you may want to disable the inline styles provided by Hugo:
|
**Note:** If you use the _simple mode_ for Twitter, you may want to disable the inline styles provided by Hugo:
|
||||||
|
|
||||||
{{< code-toggle file="config">}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[services]
|
[services]
|
||||||
[services.twitter]
|
[services.twitter]
|
||||||
disableInlineCSS = true
|
disableInlineCSS = true
|
||||||
|
|
|
@ -39,6 +39,7 @@ hugo [flags]
|
||||||
--enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages
|
--enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages
|
||||||
-e, --environment string build environment
|
-e, --environment string build environment
|
||||||
--forceSyncStatic copy all files when static is changed.
|
--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
|
--gc enable to run some cleanup tasks (remove unused cache files) after the build
|
||||||
-h, --help help for hugo
|
-h, --help help for hugo
|
||||||
--ignoreCache ignores the cache directory
|
--ignoreCache ignores the cache directory
|
||||||
|
|
|
@ -28,6 +28,7 @@ See each sub-command's help for details on how to use the generated script.
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -51,6 +51,7 @@ hugo completion bash
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -42,6 +42,7 @@ hugo completion fish [flags]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -39,6 +39,7 @@ hugo completion powershell [flags]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -53,6 +53,7 @@ hugo completion zsh [flags]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -26,6 +26,7 @@ hugo config mounts [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -31,6 +31,7 @@ hugo convert toJSON [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -31,6 +31,7 @@ hugo convert toTOML [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -31,6 +31,7 @@ hugo convert toYAML [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -30,6 +30,7 @@ hugo env [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -26,6 +26,7 @@ hugo gen [command] [flags]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -35,6 +35,7 @@ hugo gen chromastyles [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -36,6 +36,7 @@ hugo gen doc [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -33,6 +33,7 @@ hugo gen man [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -32,6 +32,7 @@ hugo import [command] [flags]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -33,6 +33,7 @@ hugo import jekyll [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -30,6 +30,7 @@ hugo list all [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -30,6 +30,7 @@ hugo list drafts [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -30,6 +30,7 @@ hugo list expired [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -30,6 +30,7 @@ hugo list future [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -32,6 +32,7 @@ hugo mod clean [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -56,6 +56,7 @@ hugo mod get [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -33,6 +33,7 @@ hugo mod graph [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -37,6 +37,7 @@ hugo mod init [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -30,6 +30,7 @@ hugo mod npm [command] [flags]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -40,6 +40,7 @@ hugo mod npm pack [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -26,6 +26,7 @@ hugo mod tidy [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -32,6 +32,7 @@ hugo mod vendor [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -31,6 +31,7 @@ hugo mod verify [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -30,6 +30,7 @@ hugo version [flags] [args]
|
||||||
--debug debug output
|
--debug debug output
|
||||||
-d, --destination string filesystem path to write files to
|
-d, --destination string filesystem path to write files to
|
||||||
-e, --environment string build environment
|
-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
|
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||||
--log enable Logging
|
--log enable Logging
|
||||||
--logFile string log File path (if set, logging enabled automatically)
|
--logFile string log File path (if set, logging enabled automatically)
|
||||||
|
|
|
@ -139,7 +139,7 @@ produces this HTML:
|
||||||
|
|
||||||
## Ref and RelRef Configuration
|
## Ref and RelRef Configuration
|
||||||
|
|
||||||
The behavior can, since Hugo 0.45, be configured in `config.toml`:
|
The behavior can, since Hugo 0.45, be configured in `hugo.toml`:
|
||||||
|
|
||||||
refLinksErrorLevel ("ERROR")
|
refLinksErrorLevel ("ERROR")
|
||||||
: When using `ref` or `relref` to resolve page links and a link cannot resolved, it will be logged with this log level. Valid values are `ERROR` (default) or `WARNING`. Any `ERROR` will fail the build (`exit -1`).
|
: When using `ref` or `relref` to resolve page links and a link cannot resolved, it will be logged with this log level. Valid values are `ERROR` (default) or `WARNING`. Any `ERROR` will fail the build (`exit -1`).
|
||||||
|
|
|
@ -135,7 +135,7 @@ weight
|
||||||
: Field name of the *plural* form of the index. See `tags` and `categories` in the above front matter examples. *Note that the plural form of user-defined taxonomies cannot be the same as any of the predefined front matter variables.*
|
: Field name of the *plural* form of the index. See `tags` and `categories` in the above front matter examples. *Note that the plural form of user-defined taxonomies cannot be the same as any of the predefined front matter variables.*
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
If neither `slug` nor `url` is present and [permalinks are not configured otherwise in your site `config` file](/content-management/urls/#permalinks), Hugo will use the filename of your content to create the output URL. See [Content Organization](/content-management/organization) for an explanation of paths in Hugo and [URL Management](/content-management/urls/) for ways to customize Hugo's default behaviors.
|
If neither `slug` nor `url` is present and [permalinks are not configured otherwise in your site configuration file](/content-management/urls/#permalinks), Hugo will use the filename of your content to create the output URL. See [Content Organization](/content-management/organization) for an explanation of paths in Hugo and [URL Management](/content-management/urls/) for ways to customize Hugo's default behaviors.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
### User-Defined
|
### User-Defined
|
||||||
|
|
|
@ -384,7 +384,7 @@ Note the self-closing shortcode syntax above. You may call the `imgproc` shortco
|
||||||
|
|
||||||
Define an `imaging` section in your site configuration to set the default [image processing options](#image-processing-options).
|
Define an `imaging` section in your site configuration to set the default [image processing options](#image-processing-options).
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=true >}}
|
{{< code-toggle file="hugo" copy=true >}}
|
||||||
[imaging]
|
[imaging]
|
||||||
resampleFilter = "Box"
|
resampleFilter = "Box"
|
||||||
quality = 75
|
quality = 75
|
||||||
|
@ -412,7 +412,7 @@ resampleFilter
|
||||||
|
|
||||||
Define an `imaging.exif` section in your site configuration to control the availability of Exif data.
|
Define an `imaging.exif` section in your site configuration to control the availability of Exif data.
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=true >}}
|
{{< code-toggle file="hugo" copy=true >}}
|
||||||
[imaging.exif]
|
[imaging.exif]
|
||||||
includeFields = ""
|
includeFields = ""
|
||||||
excludeFields = ""
|
excludeFields = ""
|
||||||
|
|
|
@ -36,7 +36,7 @@ Although you can use these methods in combination when defining a menu, the menu
|
||||||
|
|
||||||
To automatically define menu entries for each top-level section of your site, enable the section pages menu in your site configuration.
|
To automatically define menu entries for each top-level section of your site, enable the section pages menu in your site configuration.
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
sectionPagesMenu = "main"
|
sectionPagesMenu = "main"
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ Access the entry with `site.Menus.main` in your templates. See [menu templates]
|
||||||
|
|
||||||
To define entries for the "main" menu:
|
To define entries for the "main" menu:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[[menu.main]]
|
[[menu.main]]
|
||||||
name = 'Home'
|
name = 'Home'
|
||||||
pageRef = '/'
|
pageRef = '/'
|
||||||
|
@ -132,7 +132,7 @@ This creates a menu structure that you can access with `site.Menus.main` in your
|
||||||
|
|
||||||
To define entries for the "footer" menu:
|
To define entries for the "footer" menu:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[[menu.footer]]
|
[[menu.footer]]
|
||||||
name = 'Terms'
|
name = 'Terms'
|
||||||
pageRef = '/terms'
|
pageRef = '/terms'
|
||||||
|
@ -177,7 +177,7 @@ url
|
||||||
|
|
||||||
This nested menu demonstrates some of the available properties:
|
This nested menu demonstrates some of the available properties:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[[menu.main]]
|
[[menu.main]]
|
||||||
name = 'Products'
|
name = 'Products'
|
||||||
pageRef = '/products'
|
pageRef = '/products'
|
||||||
|
|
|
@ -21,7 +21,7 @@ Also See [Hugo Multilingual Part 1: Content translation].
|
||||||
|
|
||||||
The following is an example of a site configuration for a multilingual Hugo project:
|
The following is an example of a site configuration for a multilingual Hugo project:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
defaultContentLanguage = "en"
|
defaultContentLanguage = "en"
|
||||||
copyright = "Everything is mine"
|
copyright = "Everything is mine"
|
||||||
|
|
||||||
|
@ -73,10 +73,10 @@ Only the obvious non-global options can be overridden per language. Examples of
|
||||||
|
|
||||||
{{< new-in "0.112.0" >}}
|
{{< new-in "0.112.0" >}}
|
||||||
|
|
||||||
In version `0.112.0` of Hugo we did a major we consolidated all configuration options, but also improved how the languages and their params gets merged with the main configuration. But while testing this on Hugo sites out there, we got some error reports.
|
In Hugo `v0.112.0` we consolidated all configuration options, and improved how the languages and their parameters are merged with the main configuration. But while testing this on Hugo sites out there, we received some error reports and reverted some of the changes in favor of deprecation warnings:
|
||||||
|
|
||||||
1. `site.Language.Params` is deprecated. Use `site.Params` directly.
|
1. `site.Language.Params` is deprecated. Use `site.Params` directly.
|
||||||
1. The `params` sections on site and language is the only place to put custom user parameters, and `site.Params` will only contain these user defined parameters (see example below).
|
1. Adding custom params to the top level language config is deprecated, add all of these below `[params]`, see `color` in the example below.
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
title = "My blog"
|
title = "My blog"
|
||||||
|
@ -90,7 +90,7 @@ languageCode = "sv"
|
||||||
color = "blue"
|
color = "blue"
|
||||||
```
|
```
|
||||||
|
|
||||||
In the example above, all the settings exept the `color` below `params` maps to predefined configuration options in Hguo for the site and its language, and should be accessed via the documented accessors:
|
In the example above, all settings except `color` below `params` map to predefined configuration options in Hugo for the site and its language, and should be accessed via the documented accessors:
|
||||||
|
|
||||||
```
|
```
|
||||||
{{ site.Title }}
|
{{ site.Title }}
|
||||||
|
@ -102,7 +102,7 @@ In the example above, all the settings exept the `color` below `params` maps to
|
||||||
|
|
||||||
You can disable one or more languages. This can be useful when working on a new translation.
|
You can disable one or more languages. This can be useful when working on a new translation.
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
disableLanguages = ["fr", "ja"]
|
disableLanguages = ["fr", "ja"]
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ We kept this as a standalone setting to make it easier to set via [OS environmen
|
||||||
HUGO_DISABLELANGUAGES="fr ja" hugo
|
HUGO_DISABLELANGUAGES="fr ja" hugo
|
||||||
```
|
```
|
||||||
|
|
||||||
If you have already a list of disabled languages in `config.toml`, you can enable them in development like this:
|
If you have already a list of disabled languages in `hugo.toml`, you can enable them in development like this:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
HUGO_DISABLELANGUAGES=" " hugo server
|
HUGO_DISABLELANGUAGES=" " hugo server
|
||||||
|
@ -132,7 +132,7 @@ If a `baseURL` is set on the `language` level, then all languages must have one
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[languages]
|
[languages]
|
||||||
[languages.fr]
|
[languages.fr]
|
||||||
baseURL = "https://example.fr"
|
baseURL = "https://example.fr"
|
||||||
|
@ -194,7 +194,7 @@ If a file has no language code, it will be assigned the default language.
|
||||||
|
|
||||||
This system uses different content directories for each of the languages. Each language's content directory is set using the `contentDir` param.
|
This system uses different content directories for each of the languages. Each language's content directory is set using the `contentDir` param.
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
languages:
|
languages:
|
||||||
en:
|
en:
|
||||||
weight: 10
|
weight: 10
|
||||||
|
@ -400,7 +400,7 @@ In case you need to pass a custom data: (`(dict "Count" numeric_value_only)` is
|
||||||
|
|
||||||
The following localization examples assume your site's primary language is English, with translations to French and German.
|
The following localization examples assume your site's primary language is English, with translations to French and German.
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
defaultContentLanguage = 'en'
|
defaultContentLanguage = 'en'
|
||||||
|
|
||||||
[languages]
|
[languages]
|
||||||
|
@ -522,7 +522,7 @@ The `identifier` depends on how you define menu entries:
|
||||||
|
|
||||||
For example, if you define menu entries in site configuration:
|
For example, if you define menu entries in site configuration:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[[menu.main]]
|
[[menu.main]]
|
||||||
identifier = 'products'
|
identifier = 'products'
|
||||||
name = 'Products'
|
name = 'Products'
|
||||||
|
@ -551,7 +551,7 @@ services = 'Leistungen'
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[languages.de]
|
[languages.de]
|
||||||
languageCode = 'de-DE'
|
languageCode = 'de-DE'
|
||||||
languageName = 'Deutsch'
|
languageName = 'Deutsch'
|
||||||
|
|
|
@ -78,7 +78,7 @@ MediaType.MainType
|
||||||
: The main type of the resource's MIME type. For example, a file of MIME type `application/pdf` has for MainType `application`.
|
: The main type of the resource's MIME type. For example, a file of MIME type `application/pdf` has for MainType `application`.
|
||||||
|
|
||||||
MediaType.SubType
|
MediaType.SubType
|
||||||
: The subtype of the resource's MIME type. For example, a file of MIME type `application/pdf` has for SubType `pdf`. Note that this is not the same as the file extension - PowerPoint files have a subtype of `vnd.mspowerpoint`.
|
: The subtype of the resource's MIME type. For example, a file of MIME type `application/pdf` has for SubType `pdf`. Note that this is not the same as the file extension. For example, Microsoft PowerPoint files (`.ppt`) have a subtype of `vnd.ms-powerpoint`.
|
||||||
|
|
||||||
MediaType.Suffixes
|
MediaType.Suffixes
|
||||||
: A slice of possible suffixes for the resource's MIME type.
|
: A slice of possible suffixes for the resource's MIME type.
|
||||||
|
|
|
@ -66,7 +66,7 @@ We improved and simplified this feature in Hugo 0.111.0. Before this we had 3 di
|
||||||
|
|
||||||
Hugo can index the headings in your content and use this to find related content. You can enable this by adding a index of type `fragments` to your `related` configuration:
|
Hugo can index the headings in your content and use this to find related content. You can enable this by adding a index of type `fragments` to your `related` configuration:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[related]
|
[related]
|
||||||
threshold = 20
|
threshold = 20
|
||||||
includeNewer = true
|
includeNewer = true
|
||||||
|
@ -113,7 +113,7 @@ Hugo provides a sensible default configuration of Related Content, but you can f
|
||||||
|
|
||||||
Without any `related` configuration set on the project, Hugo's Related Content methods will use the following.
|
Without any `related` configuration set on the project, Hugo's Related Content methods will use the following.
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
related:
|
related:
|
||||||
threshold: 80
|
threshold: 80
|
||||||
includeNewer: false
|
includeNewer: false
|
||||||
|
|
|
@ -225,7 +225,7 @@ You must obtain an Access Token to use the `instagram` shortcode.
|
||||||
|
|
||||||
If your site configuration is private:
|
If your site configuration is private:
|
||||||
|
|
||||||
{{< code-toggle file=config copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[services.instagram]
|
[services.instagram]
|
||||||
accessToken = 'xxx'
|
accessToken = 'xxx'
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
|
@ -28,7 +28,7 @@ This union filesystem will be served from your site root. So a file
|
||||||
Here's an example of setting `staticDir` and `staticDir2` for a
|
Here's an example of setting `staticDir` and `staticDir2` for a
|
||||||
multi-language site:
|
multi-language site:
|
||||||
|
|
||||||
{{< code-toggle copy=false file="config" >}}
|
{{< code-toggle copy=false file="hugo" >}}
|
||||||
staticDir = ["static1", "static2"]
|
staticDir = ["static1", "static2"]
|
||||||
|
|
||||||
[languages]
|
[languages]
|
||||||
|
|
|
@ -82,7 +82,7 @@ Hugo natively supports taxonomies.
|
||||||
|
|
||||||
Without adding a single line to your [site config][config] file, Hugo will automatically create taxonomies for `tags` and `categories`. That would be the same as manually [configuring your taxonomies](#configure-taxonomies) as below:
|
Without adding a single line to your [site config][config] file, Hugo will automatically create taxonomies for `tags` and `categories`. That would be the same as manually [configuring your taxonomies](#configure-taxonomies) as below:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
tag = "tags"
|
tag = "tags"
|
||||||
category = "categories"
|
category = "categories"
|
||||||
|
@ -90,7 +90,7 @@ Without adding a single line to your [site config][config] file, Hugo will autom
|
||||||
|
|
||||||
If you do not want Hugo to create any taxonomies, set `disableKinds` in your [site config][config] to the following:
|
If you do not want Hugo to create any taxonomies, set `disableKinds` in your [site config][config] to the following:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
disableKinds = ["taxonomy","term"]
|
disableKinds = ["taxonomy","term"]
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ Custom taxonomies other than the [defaults](#default-taxonomies) must be defined
|
||||||
While adding custom taxonomies, you need to put in the default taxonomies too, _if you want to keep them_.
|
While adding custom taxonomies, you need to put in the default taxonomies too, _if you want to keep them_.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
tag = "tags"
|
tag = "tags"
|
||||||
category = "categories"
|
category = "categories"
|
||||||
|
@ -124,7 +124,7 @@ While adding custom taxonomies, you need to put in the default taxonomies too, _
|
||||||
|
|
||||||
If you want to have just the default `tags` taxonomy, and remove the `categories` taxonomy for your site, you can do so by modifying the `taxonomies` value in your [site config][config].
|
If you want to have just the default `tags` taxonomy, and remove the `categories` taxonomy for your site, you can do so by modifying the `taxonomies` value in your [site config][config].
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[taxonomies]
|
[taxonomies]
|
||||||
tag = "tags"
|
tag = "tags"
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
|
|
|
@ -110,7 +110,7 @@ content/
|
||||||
|
|
||||||
Create a date-based hierarchy, recursively, for regular pages within the `posts` section:
|
Create a date-based hierarchy, recursively, for regular pages within the `posts` section:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[permalinks]
|
[permalinks]
|
||||||
posts = '/posts/:year/:month/:title/'
|
posts = '/posts/:year/:month/:title/'
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
@ -133,7 +133,7 @@ public/
|
||||||
|
|
||||||
To create a date-based hierarchy for regular pages in the content root:
|
To create a date-based hierarchy for regular pages in the content root:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[permalinks]
|
[permalinks]
|
||||||
'/' = '/:year/:month/:title/'
|
'/' = '/:year/:month/:title/'
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
@ -144,7 +144,7 @@ A URL pattern defined for the content root is not recursive.
|
||||||
|
|
||||||
Use the same approach with taxonomies. For example, to omit the taxonomy segment of the URL:
|
Use the same approach with taxonomies. For example, to omit the taxonomy segment of the URL:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[permalinks]
|
[permalinks]
|
||||||
'tags' = '/:title/'
|
'tags' = '/:title/'
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
@ -198,7 +198,7 @@ For time-related values, you can also use the layout string components defined i
|
||||||
|
|
||||||
[time package]: https://pkg.go.dev/time#pkg-constants
|
[time package]: https://pkg.go.dev/time#pkg-constants
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
permalinks:
|
permalinks:
|
||||||
posts: /:06/:1/:2/:title/
|
posts: /:06/:1/:2/:title/
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
@ -214,7 +214,7 @@ pretty|content/about.md|`https://example.org/about/`
|
||||||
|
|
||||||
By default, Hugo produces pretty URLs. To generate ugly URLs, change your site configuration:
|
By default, Hugo produces pretty URLs. To generate ugly URLs, change your site configuration:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
uglyURLs = true
|
uglyURLs = true
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ This is an imperfect, brute force approach that can affect content as well as HT
|
||||||
|
|
||||||
To enable:
|
To enable:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
canonifyURLs = true
|
canonifyURLs = true
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ This is an imperfect, brute force approach that can affect content as well as HT
|
||||||
|
|
||||||
To enable:
|
To enable:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
relativeURLs = true
|
relativeURLs = true
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ fm
|
||||||
#### Site configuration example
|
#### Site configuration example
|
||||||
|
|
||||||
```text
|
```text
|
||||||
{{</* code-toggle file="config" */>}}
|
{{</* code-toggle file="hugo" */>}}
|
||||||
baseURL = 'https://example.org'
|
baseURL = 'https://example.org'
|
||||||
languageCode = 'en-US'
|
languageCode = 'en-US'
|
||||||
title = "Example Site"
|
title = "Example Site"
|
||||||
|
@ -137,7 +137,7 @@ title = "Example Site"
|
||||||
|
|
||||||
Rendered:
|
Rendered:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
baseURL = 'https://example.org'
|
baseURL = 'https://example.org'
|
||||||
languageCode = 'en-US'
|
languageCode = 'en-US'
|
||||||
title = "Example Site"
|
title = "Example Site"
|
||||||
|
|
|
@ -13,32 +13,35 @@ relatedfuncs: []
|
||||||
|
|
||||||
`hugo` returns an instance that contains the following functions:
|
`hugo` returns an instance that contains the following functions:
|
||||||
|
|
||||||
hugo.Generator
|
`hugo.BuildDate`
|
||||||
: `<meta>` tag for the version of Hugo that generated the site. `hugo.Generator` outputs a *complete* HTML tag; e.g. `<meta name="generator" content="Hugo 0.63.2">`
|
: (`string`) The compile date of the current Hugo binary formatted per [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) (e.g., `2023-05-23T08:14:20Z`).
|
||||||
|
|
||||||
hugo.Version
|
`hugo.CommitHash`
|
||||||
: the current version of the Hugo binary you are using e.g. `0.99.1`
|
: (`string`) The Git commit hash of the Hugo binary (e.g., `0a95d6704a8ac8d41cc5ca8fffaad8c5c7a3754a`).
|
||||||
|
|
||||||
hugo.GoVersion
|
`hugo.Deps`
|
||||||
: returns the version of Go that the Hugo binary was built with. {{< new-in "0.101.0" >}}
|
: (`[]*hugo.Dependency`) See [hugo.Deps](#hugodeps).
|
||||||
|
|
||||||
hugo.Environment
|
`hugo.Environment`
|
||||||
: the current running environment as defined through the `--environment` cli tag
|
: (`string`) The current running environment as defined through the `--environment` CLI flag (e.g., `development`, `production`).
|
||||||
|
|
||||||
hugo.CommitHash
|
`hugo.Generator`
|
||||||
: the git commit hash of the current Hugo binary e.g. `0e8bed9ccffba0df554728b46c5bbf6d78ae5247`
|
: (`template.HTML`) Renders an HTML `meta` element identifying the software that generated the site (e.g., `<meta name="generator" content="Hugo 0.112.0">`).
|
||||||
|
|
||||||
hugo.BuildDate
|
`hugo.GoVersion`
|
||||||
: the compile date of the current Hugo binary formatted with RFC 3339 e.g. `2002-10-02T10:00:00-05:00`
|
: (`string`) The Go version used to compile the Hugo binary (e.g., `go1.20.4`). {{< new-in "0.101.0" >}}
|
||||||
|
|
||||||
hugo.IsExtended
|
`hugo.IsExtended`
|
||||||
: whether this is the extended Hugo binary.
|
: (`bool`) Returns `true` if the Hugo binary is the extended version.
|
||||||
|
|
||||||
hugo.IsProduction
|
`hugo.IsProduction`
|
||||||
: returns true if `hugo.Environment` is set to the production environment
|
: (`bool`) Returns `true` if `hugo.Environment` is set to the production environment.
|
||||||
|
|
||||||
hugo.Deps
|
`hugo.Version`
|
||||||
: See [hugo.Deps](#hugodeps)
|
: (`hugo.VersionString`) The current version of the Hugo binary (e.g., `0.112.1`).
|
||||||
|
|
||||||
|
`hugo.WorkingDir`
|
||||||
|
: (`string`) The project working directory (e.g., `/home/user/projects/my-hugo-site`). {{< new-in "0.112.0" >}}
|
||||||
|
|
||||||
## hugo.Deps
|
## hugo.Deps
|
||||||
|
|
||||||
|
@ -48,28 +51,28 @@ hugo.Deps
|
||||||
|
|
||||||
Each dependency contains:
|
Each dependency contains:
|
||||||
|
|
||||||
Path (string)
|
|
||||||
: Returns the path to this module. This will either be the module path, e.g. "github.com/gohugoio/myshortcodes", or the path below your /theme folder, e.g. "mytheme".
|
|
||||||
|
|
||||||
Version (string)
|
|
||||||
: The module version.
|
|
||||||
|
|
||||||
Vendor (bool)
|
|
||||||
: Whether this dependency is vendored.
|
|
||||||
|
|
||||||
Time (time.Time)
|
|
||||||
: Time version was created.
|
|
||||||
|
|
||||||
Owner
|
Owner
|
||||||
: In the dependency tree, this is the first module that defines this module as a dependency.
|
: (`*hugo.Dependency`) In the dependency tree, this is the first module that defines this module as a dependency (e.g., `github.com/gohugoio/hugo-mod-bootstrap-scss/v5`).
|
||||||
|
|
||||||
Replace (*Dependency)
|
Path
|
||||||
: Replaced by this dependency.
|
: (`string`) The module path or the path below your `themes` directory (e.g., `github.com/gohugoio/hugo-mod-jslibs-dist/popperjs/v2`).
|
||||||
|
|
||||||
|
Replace
|
||||||
|
: (`*hugo.Dependency`) Replaced by this dependency.
|
||||||
|
|
||||||
|
Time
|
||||||
|
: (`time.Time`) The time that the version was created (e.g., `2022-02-13 15:11:28 +0000 UTC`).
|
||||||
|
|
||||||
|
Vendor
|
||||||
|
: (`bool`) Returns `true` if the dependency is vendored.
|
||||||
|
|
||||||
|
Version
|
||||||
|
: (`string`) The module version (e.g., `v2.21100.20000`).
|
||||||
|
|
||||||
An example table listing the dependencies:
|
An example table listing the dependencies:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<h2>Dependencies</h2>
|
<h2>Dependencies</h2>
|
||||||
<table class="table table-dark">
|
<table class="table table-dark">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -17,7 +17,7 @@ For example, to show a table of contents on every page, but allow authors to hid
|
||||||
|
|
||||||
**Configuration**
|
**Configuration**
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[params]
|
[params]
|
||||||
display_toc = true
|
display_toc = true
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
|
@ -12,9 +12,9 @@ relatedfuncs: []
|
||||||
|
|
||||||
It should not be used for HTML from a third-party, or HTML with unclosed tags or comments.
|
It should not be used for HTML from a third-party, or HTML with unclosed tags or comments.
|
||||||
|
|
||||||
Given a site-wide [`config.toml`][config] with the following `copyright` value:
|
Given a site-wide [`hugo.toml`][config] with the following `copyright` value:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
copyright = "© 2015 Jane Doe. <a href=\"https://creativecommons.org/licenses/by/4.0/\">Some rights reserved</a>."
|
copyright = "© 2015 Jane Doe. <a href=\"https://creativecommons.org/licenses/by/4.0/\">Some rights reserved</a>."
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ relatedfuncs: []
|
||||||
|
|
||||||
Given a site configuration that contains this menu entry:
|
Given a site configuration that contains this menu entry:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[[menu.main]]
|
[[menu.main]]
|
||||||
name = "IRC"
|
name = "IRC"
|
||||||
url = "irc://irc.freenode.net/#golang"
|
url = "irc://irc.freenode.net/#golang"
|
||||||
|
|
|
@ -14,9 +14,9 @@ relatedfuncs: []
|
||||||
|
|
||||||
Without `safeURL`, only the URI schemes `http:`, `https:` and `mailto:` are considered safe by Go templates. If any other URI schemes (e.g., `irc:` and `javascript:`) are detected, the whole URL will be replaced with `#ZgotmplZ`. This is to "defang" any potential attack in the URL by rendering it useless.
|
Without `safeURL`, only the URI schemes `http:`, `https:` and `mailto:` are considered safe by Go templates. If any other URI schemes (e.g., `irc:` and `javascript:`) are detected, the whole URL will be replaced with `#ZgotmplZ`. This is to "defang" any potential attack in the URL by rendering it useless.
|
||||||
|
|
||||||
The following examples use a [site `config.toml`][configuration] with the following [menu entry][menus]:
|
The following examples use a [site `hugo.toml`][configuration] with the following [menu entry][menus]:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[[menu.main]]
|
[[menu.main]]
|
||||||
name = "IRC: #golang at freenode"
|
name = "IRC: #golang at freenode"
|
||||||
url = "irc://irc.freenode.net/#golang"
|
url = "irc://irc.freenode.net/#golang"
|
||||||
|
|
|
@ -18,7 +18,7 @@ The `ORDER` may be either `asc` (ascending) or `desc` (descending). The default
|
||||||
|
|
||||||
The examples below assume this site configuration:
|
The examples below assume this site configuration:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[params]
|
[params]
|
||||||
grades = ['b','a','c']
|
grades = ['b','a','c']
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
@ -48,7 +48,7 @@ In the example above, `value` is the `KEY` representing the value of the slice e
|
||||||
|
|
||||||
The examples below assume this site configuration:
|
The examples below assume this site configuration:
|
||||||
|
|
||||||
{{< code-toggle file="config" copy=false >}}
|
{{< code-toggle file="hugo" copy=false >}}
|
||||||
[params.authors.a]
|
[params.authors.a]
|
||||||
firstName = "Marius"
|
firstName = "Marius"
|
||||||
lastName = "Pontmercy"
|
lastName = "Pontmercy"
|
||||||
|
|
|
@ -158,7 +158,7 @@ will default to the *section with the most pages*.
|
||||||
|
|
||||||
The user can override the default:
|
The user can override the default:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[params]
|
[params]
|
||||||
mainSections = ["blog", "docs"]
|
mainSections = ["blog", "docs"]
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
|
@ -15,8 +15,8 @@ toc: true
|
||||||
|
|
||||||
## Configuration File
|
## Configuration File
|
||||||
|
|
||||||
Hugo uses the `config.toml`, `config.yaml`, or `config.json` (if found in the
|
Hugo uses the `hugo.toml`, `hugo.yaml`, or `hugo.json` (if found in the
|
||||||
site root) as the default site config file.
|
site root) as the default site configuration file.
|
||||||
|
|
||||||
The user can choose to override that default with one or more site config files
|
The user can choose to override that default with one or more site config files
|
||||||
using the command-line `--config` switch.
|
using the command-line `--config` switch.
|
||||||
|
@ -45,7 +45,7 @@ In addition to using a single site config file, one can use the `configDir` dire
|
||||||
- Each file represents a configuration root object, such as `params.toml` for `[Params]`, `menu(s).toml` for `[Menu]`, `languages.toml` for `[Languages]` etc...
|
- Each file represents a configuration root object, such as `params.toml` for `[Params]`, `menu(s).toml` for `[Menu]`, `languages.toml` for `[Languages]` etc...
|
||||||
- Each file's content must be top-level, for example:
|
- Each file's content must be top-level, for example:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[Params]
|
[Params]
|
||||||
foo = "bar"
|
foo = "bar"
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
@ -61,35 +61,35 @@ foo = "bar"
|
||||||
```txt
|
```txt
|
||||||
├── config
|
├── config
|
||||||
│ ├── _default
|
│ ├── _default
|
||||||
│ │ ├── config.toml
|
│ │ ├── hugo.toml
|
||||||
│ │ ├── languages.toml
|
│ │ ├── languages.toml
|
||||||
│ │ ├── menus.en.toml
|
│ │ ├── menus.en.toml
|
||||||
│ │ ├── menus.zh.toml
|
│ │ ├── menus.zh.toml
|
||||||
│ │ └── params.toml
|
│ │ └── params.toml
|
||||||
│ ├── production
|
│ ├── production
|
||||||
│ │ ├── config.toml
|
│ │ ├── hugo.toml
|
||||||
│ │ └── params.toml
|
│ │ └── params.toml
|
||||||
│ └── staging
|
│ └── staging
|
||||||
│ ├── config.toml
|
│ ├── hugo.toml
|
||||||
│ └── params.toml
|
│ └── params.toml
|
||||||
```
|
```
|
||||||
|
|
||||||
Considering the structure above, when running `hugo --environment staging`, Hugo will use every setting from `config/_default` and merge `staging`'s on top of those.
|
Considering the structure above, when running `hugo --environment staging`, Hugo will use every setting from `config/_default` and merge `staging`'s on top of those.
|
||||||
|
|
||||||
Let's take an example to understand this better. Let's say you are using Google Analytics for your website. This requires you to specify `googleAnalytics = "G-XXXXXXXX"` in `config.toml`. Now consider the following scenario:
|
Let's take an example to understand this better. Let's say you are using Google Analytics for your website. This requires you to specify `googleAnalytics = "G-XXXXXXXX"` in `hugo.toml`. Now consider the following scenario:
|
||||||
- You don't want the Analytics code to be loaded in development i.e. in your `localhost`
|
- You don't want the Analytics code to be loaded in development i.e. in your `localhost`
|
||||||
- You want to use separate googleAnalytics IDs for your production & staging environments (say):
|
- You want to use separate googleAnalytics IDs for your production & staging environments (say):
|
||||||
- `G-PPPPPPPP` for production
|
- `G-PPPPPPPP` for production
|
||||||
- `G-SSSSSSSS` for staging
|
- `G-SSSSSSSS` for staging
|
||||||
|
|
||||||
This is how you need to configure your `config.toml` files considering the above scenario:
|
This is how you need to configure your `hugo.toml` files considering the above scenario:
|
||||||
1. In `_default/config.toml` you don't need to mention `googleAnalytics` parameter at all. This ensures that no Google Analytics code is loaded in your development server i.e. when you run `hugo server`. This works since, by default Hugo sets `Environment=development` when you run `hugo server` which uses the config files from `_default` folder
|
1. In `_default/hugo.toml` you don't need to mention `googleAnalytics` parameter at all. This ensures that no Google Analytics code is loaded in your development server i.e. when you run `hugo server`. This works since, by default Hugo sets `Environment=development` when you run `hugo server` which uses the config files from `_default` folder
|
||||||
2. In `production/config.toml` you just need to have one line:
|
2. In `production/hugo.toml` you just need to have one line:
|
||||||
|
|
||||||
```googleAnalytics = "G-PPPPPPPP"```
|
```googleAnalytics = "G-PPPPPPPP"```
|
||||||
|
|
||||||
You don't need to mention all other parameters like `title`, `baseURL`, `theme` etc. again in this config file. You need to mention only those parameters which are different or new for the production environment. This is due to the fact that Hugo is going to __merge__ this on top of `_default/config.toml`. Now when you run `hugo` (build command), by default hugo sets `Environment=production`, so the `G-PPPPPPPP` analytics code will be there in your production website
|
You don't need to mention all other parameters like `title`, `baseURL`, `theme` etc. again in this config file. You need to mention only those parameters which are different or new for the production environment. This is due to the fact that Hugo is going to __merge__ this on top of `_default/hugo.toml`. Now when you run `hugo` (build command), by default hugo sets `Environment=production`, so the `G-PPPPPPPP` analytics code will be there in your production website
|
||||||
3. Similarly in `staging/config.toml` you just need to have one line:
|
3. Similarly in `staging/hugo.toml` you just need to have one line:
|
||||||
|
|
||||||
```googleAnalytics = "G-SSSSSSSS"```
|
```googleAnalytics = "G-SSSSSSSS"```
|
||||||
|
|
||||||
|
@ -378,7 +378,7 @@ The directory to where Hugo will write the final static site (the HTML files etc
|
||||||
|
|
||||||
### related
|
### related
|
||||||
|
|
||||||
: See [Related Content](/content-management/related/#configure-related-content).
|
See [Related Content](/content-management/related/#configure-related-content).
|
||||||
|
|
||||||
### relativeURLs
|
### relativeURLs
|
||||||
|
|
||||||
|
@ -494,7 +494,7 @@ enableemoji: true
|
||||||
|
|
||||||
The `build` configuration section contains global build-related configuration options.
|
The `build` configuration section contains global build-related configuration options.
|
||||||
|
|
||||||
{{< code-toggle file="config">}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[build]
|
[build]
|
||||||
useResourceCacheWhen="fallback"
|
useResourceCacheWhen="fallback"
|
||||||
writeStats = false
|
writeStats = false
|
||||||
|
@ -518,7 +518,7 @@ noJSConfigInAssets
|
||||||
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):
|
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):
|
||||||
|
|
||||||
|
|
||||||
{{< code-toggle file="config">}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[server]
|
[server]
|
||||||
[[server.headers]]
|
[[server.headers]]
|
||||||
for = "/**"
|
for = "/**"
|
||||||
|
@ -592,18 +592,18 @@ HUGO_NUMWORKERMULTIPLIER
|
||||||
|
|
||||||
Similar to the template [lookup order], Hugo has a default set of rules for searching for a configuration file in the root of your website's source directory as a default behavior:
|
Similar to the template [lookup order], Hugo has a default set of rules for searching for a configuration file in the root of your website's source directory as a default behavior:
|
||||||
|
|
||||||
1. `./config.toml`
|
1. `./hugo.toml`
|
||||||
2. `./config.yaml`
|
2. `./hugo.yaml`
|
||||||
3. `./config.json`
|
3. `./hugo.json`
|
||||||
|
|
||||||
In your `config` file, you can direct Hugo as to how you want your website rendered, control your website's menus, and arbitrarily define site-wide parameters specific to your project.
|
In your configuration file, you can direct Hugo as to how you want your website rendered, control your website's menus, and arbitrarily define site-wide parameters specific to your project.
|
||||||
|
|
||||||
|
|
||||||
## Example Configuration
|
## Example Configuration
|
||||||
|
|
||||||
The following is a typical example of a configuration file. The values nested under `params:` will populate the [`.Site.Params`] variable for use in [templates]:
|
The following is a typical example of a configuration file. The values nested under `params:` will populate the [`.Site.Params`] variable for use in [templates]:
|
||||||
|
|
||||||
{{< code-toggle file="config">}}
|
{{< code-toggle file="hugo" >}}
|
||||||
baseURL: "https://yoursite.example.com/"
|
baseURL: "https://yoursite.example.com/"
|
||||||
title: "My Hugo Site"
|
title: "My Hugo Site"
|
||||||
permalinks:
|
permalinks:
|
||||||
|
@ -650,13 +650,13 @@ To exclude specific files from the `content`, `data`, and `i18n` directories whe
|
||||||
|
|
||||||
To ignore files ending with `.foo` or `.boo`:
|
To ignore files ending with `.foo` or `.boo`:
|
||||||
|
|
||||||
{{< code-toggle copy=false >}}
|
{{< code-toggle copy=false file="hugo" >}}
|
||||||
ignoreFiles = ['\.foo$', '\.boo$']
|
ignoreFiles = ['\.foo$', '\.boo$']
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
To ignore a file using the absolute file path:
|
To ignore a file using the absolute file path:
|
||||||
|
|
||||||
{{< code-toggle copy=false >}}
|
{{< code-toggle copy=false file="hugo" >}}
|
||||||
ignoreFiles = ['^/home/user/project/content/test\.md$']
|
ignoreFiles = ['^/home/user/project/content/test\.md$']
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
|
@ -664,11 +664,11 @@ ignoreFiles = ['^/home/user/project/content/test\.md$']
|
||||||
|
|
||||||
### Configure Dates
|
### Configure Dates
|
||||||
|
|
||||||
Dates are important in Hugo, and you can configure how Hugo assigns dates to your content pages. You do this by adding a `frontmatter` section to your `config.toml`.
|
Dates are important in Hugo, and you can configure how Hugo assigns dates to your content pages. You do this by adding a `frontmatter` section to your `hugo.toml`.
|
||||||
|
|
||||||
The default configuration is:
|
The default configuration is:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[frontmatter]
|
[frontmatter]
|
||||||
date = ["date", "publishDate", "lastmod"]
|
date = ["date", "publishDate", "lastmod"]
|
||||||
lastmod = [":git", "lastmod", "date", "publishDate"]
|
lastmod = [":git", "lastmod", "date", "publishDate"]
|
||||||
|
@ -678,7 +678,7 @@ expiryDate = ["expiryDate"]
|
||||||
|
|
||||||
If you, as an example, have a non-standard date parameter in some of your content, you can override the setting for `date`:
|
If you, as an example, have a non-standard date parameter in some of your content, you can override the setting for `date`:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[frontmatter]
|
[frontmatter]
|
||||||
date = ["myDate", ":default"]
|
date = ["myDate", ":default"]
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
@ -695,7 +695,7 @@ The special date handlers are:
|
||||||
|
|
||||||
An example:
|
An example:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[frontmatter]
|
[frontmatter]
|
||||||
lastmod = ["lastmod", ":fileModTime", ":default"]
|
lastmod = ["lastmod", ":fileModTime", ":default"]
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
@ -709,7 +709,7 @@ The above will try first to extract the value for `.Lastmod` starting with the `
|
||||||
|
|
||||||
An example:
|
An example:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[frontmatter]
|
[frontmatter]
|
||||||
date = [":filename", ":default"]
|
date = [":filename", ":default"]
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
@ -734,7 +734,7 @@ Default configuration:
|
||||||
|
|
||||||
Since Hugo 0.52 you can configure more than just the `cacheDir`. This is the default configuration:
|
Since Hugo 0.52 you can configure more than just the `cacheDir`. This is the default configuration:
|
||||||
|
|
||||||
{{< code-toggle >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[caches]
|
[caches]
|
||||||
[caches.getjson]
|
[caches.getjson]
|
||||||
dir = ":cacheDir/:project"
|
dir = ":cacheDir/:project"
|
||||||
|
@ -756,7 +756,7 @@ dir = ":cacheDir/modules"
|
||||||
maxAge = -1
|
maxAge = -1
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
You can override any of these cache settings in your own `config.toml`.
|
You can override any of these cache settings in your own `hugo.toml`.
|
||||||
|
|
||||||
### The keywords explained
|
### The keywords explained
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ example/
|
||||||
├── public/
|
├── public/
|
||||||
├── static/
|
├── static/
|
||||||
├── themes/
|
├── themes/
|
||||||
└── config.toml
|
└── hugo.toml
|
||||||
```
|
```
|
||||||
|
|
||||||
## Directory Structure Explained
|
## Directory Structure Explained
|
||||||
|
@ -46,7 +46,7 @@ By default, Hugo will create new content files with at least `date`, `title` (in
|
||||||
[`config`](/getting-started/configuration/)
|
[`config`](/getting-started/configuration/)
|
||||||
: Hugo ships with a large number of [configuration directives].
|
: Hugo ships with a large number of [configuration directives].
|
||||||
The [config directory](/getting-started/configuration/#configuration-directory) is where those directives are stored as JSON, YAML, or TOML files. Every root setting object can stand as its own file and structured by environments.
|
The [config directory](/getting-started/configuration/#configuration-directory) is where those directives are stored as JSON, YAML, or TOML files. Every root setting object can stand as its own file and structured by environments.
|
||||||
Projects with minimal settings and no need for environment awareness can use a single `config.toml` file at its root.
|
Projects with minimal settings and no need for environment awareness can use a single `hugo.toml` file at its root.
|
||||||
|
|
||||||
Many sites may need little to no configuration, but Hugo ships with a large number of [configuration directives] for more granular directions on how you want Hugo to build your website. Note: config directory is not created by default.
|
Many sites may need little to no configuration, but Hugo ships with a large number of [configuration directives] for more granular directions on how you want Hugo to build your website. Note: config directory is not created by default.
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ In this tutorial you will:
|
||||||
|
|
||||||
Before you begin this tutorial you must:
|
Before you begin this tutorial you must:
|
||||||
|
|
||||||
1. [Install Hugo] (the extended edition)
|
1. [Install Hugo] (extended edition, v0.112.0 or later)
|
||||||
1. [Install Git]
|
1. [Install Git]
|
||||||
|
|
||||||
You must also be comfortable working from the command line.
|
You must also be comfortable working from the command line.
|
||||||
|
@ -51,7 +51,7 @@ hugo new site quickstart
|
||||||
cd quickstart
|
cd quickstart
|
||||||
git init
|
git init
|
||||||
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke
|
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke
|
||||||
echo "theme = 'ananke'" >> config.toml
|
echo "theme = 'ananke'" >> hugo.toml
|
||||||
hugo server
|
hugo server
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/an
|
||||||
Append a line to the site configuration file, indicating the current theme.
|
Append a line to the site configuration file, indicating the current theme.
|
||||||
|
|
||||||
```text
|
```text
|
||||||
echo "theme = 'ananke'" >> config.toml
|
echo "theme = 'ananke'" >> hugo.toml
|
||||||
```
|
```
|
||||||
|
|
||||||
Start Hugo's development server to view the site.
|
Start Hugo's development server to view the site.
|
||||||
|
@ -152,7 +152,7 @@ Hugo's rendering engine conforms to the CommonMark [specification] for markdown.
|
||||||
|
|
||||||
## Configure the site
|
## Configure the site
|
||||||
|
|
||||||
With your editor, open the [site configuration] file (`config.toml`) in the root of your project.
|
With your editor, open the [site configuration] file (`hugo.toml`) in the root of your project.
|
||||||
|
|
||||||
```text
|
```text
|
||||||
baseURL = 'http://example.org/'
|
baseURL = 'http://example.org/'
|
||||||
|
|
|
@ -13,7 +13,7 @@ toc: true
|
||||||
|
|
||||||
## Module Config: Top level
|
## Module Config: Top level
|
||||||
|
|
||||||
{{< code-toggle file="config">}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[module]
|
[module]
|
||||||
noVendor = ""
|
noVendor = ""
|
||||||
proxy = "direct"
|
proxy = "direct"
|
||||||
|
@ -56,7 +56,7 @@ env HUGO_MODULE_PROXY=https://proxy.example.org hugo
|
||||||
|
|
||||||
If your module requires a particular version of Hugo to work, you can indicate that in the `module` section and the user will be warned if using a too old/new version.
|
If your module requires a particular version of Hugo to work, you can indicate that in the `module` section and the user will be warned if using a too old/new version.
|
||||||
|
|
||||||
{{< code-toggle file="config">}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[module]
|
[module]
|
||||||
[module.hugoVersion]
|
[module.hugoVersion]
|
||||||
min = ""
|
min = ""
|
||||||
|
@ -78,7 +78,7 @@ extended
|
||||||
|
|
||||||
## Module Config: imports
|
## Module Config: imports
|
||||||
|
|
||||||
{{< code-toggle file="config">}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[module]
|
[module]
|
||||||
[[module.imports]]
|
[[module.imports]]
|
||||||
path = "github.com/gohugoio/hugoTestModules1_linux/modh1_2_1v"
|
path = "github.com/gohugoio/hugoTestModules1_linux/modh1_2_1v"
|
||||||
|
@ -93,7 +93,7 @@ path
|
||||||
: Can be either a valid Go Module module path, e.g. `github.com/gohugoio/myShortcodes`, or the directory name for the module as stored in your themes folder.
|
: Can be either a valid Go Module module path, e.g. `github.com/gohugoio/myShortcodes`, or the directory name for the module as stored in your themes folder.
|
||||||
|
|
||||||
ignoreConfig
|
ignoreConfig
|
||||||
: If enabled, any module configuration file, e.g. `config.toml`, will not be loaded. Note that this will also stop the loading of any transitive module dependencies.
|
: If enabled, any module configuration file, e.g. `hugo.toml`, will not be loaded. Note that this will also stop the loading of any transitive module dependencies.
|
||||||
|
|
||||||
ignoreImports
|
ignoreImports
|
||||||
: If enabled, module imports will not be followed.
|
: If enabled, module imports will not be followed.
|
||||||
|
@ -120,7 +120,7 @@ When you add a mount, the default mount for the concerned target root is ignored
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
**Default mounts**
|
**Default mounts**
|
||||||
{{< code-toggle file="config">}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[module]
|
[module]
|
||||||
[[module.mounts]]
|
[[module.mounts]]
|
||||||
source="content"
|
source="content"
|
||||||
|
@ -165,7 +165,7 @@ excludeFiles (string or slice)
|
||||||
: One or more glob patterns matching files to exclude.
|
: One or more glob patterns matching files to exclude.
|
||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
{{< code-toggle file="config">}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[module]
|
[module]
|
||||||
[[module.mounts]]
|
[[module.mounts]]
|
||||||
source="content"
|
source="content"
|
||||||
|
|
|
@ -17,13 +17,13 @@ This section contain information that may be outdated and is in the process of b
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
Since Hugo `0.42` a project can configure a theme as a composite of as many theme components you need:
|
Since Hugo `0.42` a project can configure a theme as a composite of as many theme components you need:
|
||||||
|
|
||||||
{{< code-toggle file="config">}}
|
{{< code-toggle file="hugo" >}}
|
||||||
theme = ["my-shortcodes", "base-theme", "hyde"]
|
theme = ["my-shortcodes", "base-theme", "hyde"]
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
You can even nest this, and have the theme component itself include theme components in its own `config.toml` (theme inheritance).[^1]
|
You can even nest this, and have the theme component itself include theme components in its own `hugo.toml` (theme inheritance).[^1]
|
||||||
|
|
||||||
The theme definition example above in `config.toml` creates a theme with 3 theme components with precedence from left to right.
|
The theme definition example above in `hugo.toml` creates a theme with 3 theme components with precedence from left to right.
|
||||||
|
|
||||||
For any given file, data entry, etc., Hugo will look first in the project and then in `my-shortcodes`, `base-theme`, and lastly `hyde`.
|
For any given file, data entry, etc., Hugo will look first in the project and then in `my-shortcodes`, `base-theme`, and lastly `hyde`.
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ Hugo uses two different algorithms to merge the filesystems, depending on the fi
|
||||||
|
|
||||||
The name used in the `theme` definition above must match a folder in `/your-site/themes`, e.g. `/your-site/themes/my-shortcodes`. There are plans to improve on this and get a URL scheme so this can be resolved automatically.
|
The name used in the `theme` definition above must match a folder in `/your-site/themes`, e.g. `/your-site/themes/my-shortcodes`. There are plans to improve on this and get a URL scheme so this can be resolved automatically.
|
||||||
|
|
||||||
Also note that a component that is part of a theme can have its own configuration file, e.g. `config.toml`. There are currently some restrictions to what a theme component can configure:
|
Also note that a component that is part of a theme can have its own configuration file, e.g. `hugo.toml`. There are currently some restrictions to what a theme component can configure:
|
||||||
|
|
||||||
* `params` (global and per language)
|
* `params` (global and per language)
|
||||||
* `menu` (global and per language)
|
* `menu` (global and per language)
|
||||||
|
|
|
@ -33,7 +33,7 @@ The easiest way to use a Module for a theme is to import it in the config.
|
||||||
1. Initialize the hugo module system: `hugo mod init github.com/<your_user>/<your_project>`
|
1. Initialize the hugo module system: `hugo mod init github.com/<your_user>/<your_project>`
|
||||||
2. Import the theme:
|
2. Import the theme:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[module]
|
[module]
|
||||||
[[module.imports]]
|
[[module.imports]]
|
||||||
path = "github.com/spf13/hyde"
|
path = "github.com/spf13/hyde"
|
||||||
|
|
|
@ -124,10 +124,19 @@ Remote resources fetched with `resources.GetRemote` will be cached on disk. See
|
||||||
`resources.Copy` allows you to copy almost any Hugo `Resource` (the one exception is the `Page`), possibly most useful for renaming things:
|
`resources.Copy` allows you to copy almost any Hugo `Resource` (the one exception is the `Page`), possibly most useful for renaming things:
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
{{ $resized := $image.Resize "400x400" | resources.Copy "images/mynewname.jpg" }}
|
{{ with resources.Get "img/a.jpg" }}
|
||||||
<img src="{{ $resized.RelPermalink }}">
|
{{ with .Resize "300x" }}
|
||||||
|
{{ with resources.Copy "img/a-new.jpg" . }}
|
||||||
|
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
{{% note %}}
|
||||||
|
The target path must be different than the source path, as shown in the example above. See GitHub issue [#10412](https://github.com/gohugoio/hugo/issues/10412).
|
||||||
|
{{% /note %}}
|
||||||
|
|
||||||
## Asset directory
|
## Asset directory
|
||||||
|
|
||||||
Asset files must be stored in the asset directory. This is `/assets` by default, but can be configured via the configuration file's `assetDir` key.
|
Asset files must be stored in the asset directory. This is `/assets` by default, but can be configured via the configuration file's `assetDir` key.
|
||||||
|
|
|
@ -36,7 +36,7 @@ There are several ways to set up CSS purging with PostCSS in Hugo. If you have a
|
||||||
|
|
||||||
The below configuration will write a `hugo_stats.json` file to the project root as part of the build. If you're only using this for the production build, you should consider placing it below [config/production](/getting-started/configuration/#configuration-directory).
|
The below configuration will write a `hugo_stats.json` file to the project root as part of the build. If you're only using this for the production build, you should consider placing it below [config/production](/getting-started/configuration/#configuration-directory).
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[build]
|
[build]
|
||||||
writeStats = true
|
writeStats = true
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
|
@ -31,12 +31,12 @@ Hugo ships with internal templates supporting Google Analytics, both [Google Ana
|
||||||
Provide your tracking ID in your configuration file:
|
Provide your tracking ID in your configuration file:
|
||||||
|
|
||||||
**Google Analytics 4 (gtag.js)**
|
**Google Analytics 4 (gtag.js)**
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
googleAnalytics = "G-MEASUREMENT_ID"
|
googleAnalytics = "G-MEASUREMENT_ID"
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
|
|
||||||
**Google Universal Analytics (analytics.js)**
|
**Google Universal Analytics (analytics.js)**
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
googleAnalytics = "UA-PROPERTY_ID"
|
googleAnalytics = "UA-PROPERTY_ID"
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ Hugo also ships with an internal template for [Disqus comments][disqus], a popul
|
||||||
|
|
||||||
To use Hugo's Disqus template, you first need to set a single configuration value:
|
To use Hugo's Disqus template, you first need to set a single configuration value:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
disqusShortname = "your-disqus-shortname"
|
disqusShortname = "your-disqus-shortname"
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ This format is used for Facebook and some other sites.
|
||||||
|
|
||||||
Hugo's Open Graph template is configured using a mix of configuration variables and [front-matter](/content-management/front-matter/) on individual pages.
|
Hugo's Open Graph template is configured using a mix of configuration variables and [front-matter](/content-management/front-matter/) on individual pages.
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[params]
|
[params]
|
||||||
title = "My cool site"
|
title = "My cool site"
|
||||||
images = ["site-feature-image.jpg"]
|
images = ["site-feature-image.jpg"]
|
||||||
|
@ -177,7 +177,7 @@ metadata used to attach rich media to Tweets linking to your site.
|
||||||
|
|
||||||
Hugo's Twitter Card template is configured using a mix of configuration variables and [front-matter](/content-management/front-matter/) on individual pages.
|
Hugo's Twitter Card template is configured using a mix of configuration variables and [front-matter](/content-management/front-matter/) on individual pages.
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[params]
|
[params]
|
||||||
images = ["site-feature-image.jpg"]
|
images = ["site-feature-image.jpg"]
|
||||||
description = "Text about my cool site"
|
description = "Text about my cool site"
|
||||||
|
@ -197,7 +197,7 @@ Hugo uses the page title and description for the card's title and description fi
|
||||||
|
|
||||||
The `.Site.Social.twitter` variable is exposed from the config as the value for `twitter:site`.
|
The `.Site.Social.twitter` variable is exposed from the config as the value for `twitter:site`.
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[social]
|
[social]
|
||||||
twitter = "GoHugoIO"
|
twitter = "GoHugoIO"
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
|
|
|
@ -562,7 +562,7 @@ You can arbitrarily define as many site-level parameters as you want in your [si
|
||||||
|
|
||||||
For instance, you might declare the following:
|
For instance, you might declare the following:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
params:
|
params:
|
||||||
copyrighthtml: "Copyright © 2017 John Doe. All Rights Reserved."
|
copyrighthtml: "Copyright © 2017 John Doe. All Rights Reserved."
|
||||||
twitteruser: "spf13"
|
twitteruser: "spf13"
|
||||||
|
|
|
@ -31,7 +31,7 @@ This is the full set of built-in media types in Hugo:
|
||||||
|
|
||||||
To add or modify a media type, define it in a `mediaTypes` section in your [site configuration][config], either for all sites or for a given language.
|
To add or modify a media type, define it in a `mediaTypes` section in your [site configuration][config], either for all sites or for a given language.
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[mediaTypes]
|
[mediaTypes]
|
||||||
[mediaTypes."text/enriched"]
|
[mediaTypes."text/enriched"]
|
||||||
suffixes = ["enr"]
|
suffixes = ["enr"]
|
||||||
|
@ -43,7 +43,7 @@ The above example adds one new media type, `text/enriched`, and changes the suff
|
||||||
|
|
||||||
**Note:** these media types are configured for **your output formats**. If you want to redefine one of Hugo's default output formats (e.g. `HTML`), you also need to redefine the media type. So, if you want to change the suffix of the `HTML` output format from `html` (default) to `htm`:
|
**Note:** these media types are configured for **your output formats**. If you want to redefine one of Hugo's default output formats (e.g. `HTML`), you also need to redefine the media type. So, if you want to change the suffix of the `HTML` output format from `html` (default) to `htm`:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[mediaTypes]
|
[mediaTypes]
|
||||||
[mediaTypes."text/html"]
|
[mediaTypes."text/html"]
|
||||||
suffixes = ["htm"]
|
suffixes = ["htm"]
|
||||||
|
@ -70,7 +70,7 @@ This is the full set of Hugo's built-in output formats:
|
||||||
|
|
||||||
To add or modify an output format, define it in an `outputFormats` section in your site's [configuration file](/getting-started/configuration/), either for all sites or for a given language.
|
To add or modify an output format, define it in an `outputFormats` section in your site's [configuration file](/getting-started/configuration/), either for all sites or for a given language.
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[outputFormats.MyEnrichedFormat]
|
[outputFormats.MyEnrichedFormat]
|
||||||
mediaType = "text/enriched"
|
mediaType = "text/enriched"
|
||||||
baseName = "myindex"
|
baseName = "myindex"
|
||||||
|
@ -146,7 +146,7 @@ per language).
|
||||||
|
|
||||||
Example from site config file:
|
Example from site config file:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[outputs]
|
[outputs]
|
||||||
home = ["HTML", "AMP", "RSS"]
|
home = ["HTML", "AMP", "RSS"]
|
||||||
page = ["HTML"]
|
page = ["HTML"]
|
||||||
|
|
|
@ -14,7 +14,7 @@ aliases: [/extras/robots-txt/]
|
||||||
|
|
||||||
To generate a robots.txt file from a template, change the [site configuration][config]:
|
To generate a robots.txt file from a template, change the [site configuration][config]:
|
||||||
|
|
||||||
{{< code-toggle file="config">}}
|
{{< code-toggle file="hugo" >}}
|
||||||
enableRobotsTXT = true
|
enableRobotsTXT = true
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
|
|
|
@ -35,11 +35,11 @@ The table below shows the RSS template lookup order for the different page kinds
|
||||||
|
|
||||||
## Configure RSS
|
## Configure RSS
|
||||||
|
|
||||||
By default, Hugo will create an unlimited number of RSS entries. You can limit the number of articles included in the built-in RSS templates by assigning a numeric value to `rssLimit:` field in your project's [`config` file][config].
|
By default, Hugo will create an unlimited number of RSS entries. You can limit the number of articles included in the built-in RSS templates by assigning a numeric value to `rssLimit:` field in your project's configuration file.
|
||||||
|
|
||||||
The following values will also be included in the RSS output if specified:
|
The following values will also be included in the RSS output if specified:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
languageCode = "en-us"
|
languageCode = "en-us"
|
||||||
copyright = "This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License."
|
copyright = "This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License."
|
||||||
|
|
||||||
|
|
|
@ -368,7 +368,7 @@ You can also implement your shortcodes inline -- e.g. where you use them in the
|
||||||
|
|
||||||
This feature is disabled by default, but can be enabled in your site config:
|
This feature is disabled by default, but can be enabled in your site config:
|
||||||
|
|
||||||
{{< code-toggle file="config">}}
|
{{< code-toggle file="hugo" >}}
|
||||||
enableInlineShortcodes = true
|
enableInlineShortcodes = true
|
||||||
{{< /code-toggle >}}
|
{{< /code-toggle >}}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ With a multilingual project, Hugo generates:
|
||||||
|
|
||||||
Set the default values for [change frequency] and [priority], and the name of the generated file, in your site configuration.
|
Set the default values for [change frequency] and [priority], and the name of the generated file, in your site configuration.
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
[sitemap]
|
[sitemap]
|
||||||
changefreq = 'monthly'
|
changefreq = 'monthly'
|
||||||
filename = 'sitemap.xml'
|
filename = 'sitemap.xml'
|
||||||
|
@ -72,7 +72,7 @@ To override the built-in sitemapindex.xml template, create a new file in either
|
||||||
|
|
||||||
You may disable sitemap generation in your site configuration:
|
You may disable sitemap generation in your site configuration:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
disableKinds = ['sitemap']
|
disableKinds = ['sitemap']
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ The following is a list of page-level variables. Many of these will be defined i
|
||||||
: the page's *kind*. Possible return values are `page`, `home`, `section`, `taxonomy`, or `term`. Note that there are also `RSS`, `sitemap`, `robotsTXT`, and `404` kinds, but these are only available during the rendering of each of these respective page's kind and therefore *not* available in any of the `Pages` collections.
|
: the page's *kind*. Possible return values are `page`, `home`, `section`, `taxonomy`, or `term`. Note that there are also `RSS`, `sitemap`, `robotsTXT`, and `404` kinds, but these are only available during the rendering of each of these respective page's kind and therefore *not* available in any of the `Pages` collections.
|
||||||
|
|
||||||
.Language
|
.Language
|
||||||
: a language object that points to the language's definition in the site `config`. `.Language.Lang` gives you the language code.
|
: a language object that points to the language's definition in the site configuration. `.Language.Lang` gives you the language code.
|
||||||
|
|
||||||
.Lastmod
|
.Lastmod
|
||||||
: the date the content was last modified. `.Lastmod` pulls from the `lastmod` field in a content's front matter.
|
: the date the content was last modified. `.Lastmod` pulls from the `lastmod` field in a content's front matter.
|
||||||
|
@ -298,7 +298,7 @@ In Hugo, you can declare params in individual pages and globally for your entire
|
||||||
{{ $.Param "header_image" }}
|
{{ $.Param "header_image" }}
|
||||||
```
|
```
|
||||||
|
|
||||||
The `.Param` method provides a way to resolve a single value according to it's definition in a page parameter (i.e. in the content's front matter) or a site parameter (i.e., in your `config`).
|
The `.Param` method provides a way to resolve a single value according to it's definition in a page parameter (i.e. in the content's front matter) or a site parameter (i.e., in your site configuration).
|
||||||
|
|
||||||
### Access Nested Fields in Front Matter
|
### Access Nested Fields in Front Matter
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ All the methods below, e.g. `.Site.RegularPages` can also be reached via the glo
|
||||||
|
|
||||||
The following `config.[yaml|toml|json]` defines a site-wide param for `description`:
|
The following `config.[yaml|toml|json]` defines a site-wide param for `description`:
|
||||||
|
|
||||||
{{< code-toggle file="config" >}}
|
{{< code-toggle file="hugo" >}}
|
||||||
baseURL = "https://yoursite.example.com/"
|
baseURL = "https://yoursite.example.com/"
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
|
@ -2,4 +2,4 @@ module github.com/gohugoio/hugoDocs
|
||||||
|
|
||||||
go 1.16
|
go 1.16
|
||||||
|
|
||||||
require github.com/gohugoio/gohugoioTheme v0.0.0-20230418063032-99f9185b8e11 // indirect
|
require github.com/gohugoio/gohugoioTheme v0.0.0-20230527124826-78bc315d7b8a // indirect
|
||||||
|
|
|
@ -63,3 +63,5 @@ github.com/gohugoio/gohugoioTheme v0.0.0-20230330081257-7a8c9614432c h1:TyHgmowf
|
||||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230330081257-7a8c9614432c/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
github.com/gohugoio/gohugoioTheme v0.0.0-20230330081257-7a8c9614432c/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230418063032-99f9185b8e11 h1:mDcricMewd66x8QjKqNun7Div7iYVLtl8s1dVs9VnB8=
|
github.com/gohugoio/gohugoioTheme v0.0.0-20230418063032-99f9185b8e11 h1:mDcricMewd66x8QjKqNun7Div7iYVLtl8s1dVs9VnB8=
|
||||||
github.com/gohugoio/gohugoioTheme v0.0.0-20230418063032-99f9185b8e11/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
github.com/gohugoio/gohugoioTheme v0.0.0-20230418063032-99f9185b8e11/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||||
|
github.com/gohugoio/gohugoioTheme v0.0.0-20230527124826-78bc315d7b8a h1:ruyA3QZ4Ym0fBLhTW2eoUSvHUaj2xWqaPHIbaI+tbZo=
|
||||||
|
github.com/gohugoio/gohugoioTheme v0.0.0-20230527124826-78bc315d7b8a/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
|
||||||
|
|
|
@ -44,7 +44,7 @@ Renders syntax-highlighted configuration data in JSON, TOML, and YAML formats.
|
||||||
{{- /* Render. */}}
|
{{- /* Render. */}}
|
||||||
{{- $code := "" }}
|
{{- $code := "" }}
|
||||||
{{- with $config }}
|
{{- with $config }}
|
||||||
{{- $file = $file | default "config" }}
|
{{- $file = $file | default "hugo" }}
|
||||||
{{- $sections := (split . ".") }}
|
{{- $sections := (split . ".") }}
|
||||||
{{- $configSection := index $.Site.Data.docs.config $sections }}
|
{{- $configSection := index $.Site.Data.docs.config $sections }}
|
||||||
{{- $code = dict $sections $configSection }}
|
{{- $code = dict $sections $configSection }}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
{{ $version := .Get 0 }}
|
{{ $version := .Get 0 }}
|
||||||
{{ if not $version }}
|
{{ if not $version }}
|
||||||
{{ errorf "Missing version in new-in shortcode "}}
|
{{ errorf "Missing version in new-in shortcode " }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ $version = $version | strings.TrimPrefix "v" }}
|
{{ $version = $version | strings.TrimPrefix "v" }}
|
||||||
<button class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 mr2 ml2 px-4 border border-gray-400 rounded shadow">
|
<button
|
||||||
<a href="{{ printf "https://github.com/gohugoio/hugo/releases/tag/v%s" $version }}" target="_blank">New in v{{$version}}</a>
|
class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 mr2 ml2 px-4 border border-gray-400 rounded shadow">
|
||||||
|
<a
|
||||||
|
href="{{ printf "https://github.com/gohugoio/hugo/releases/tag/v%s" $version }}"
|
||||||
|
target="_blank"
|
||||||
|
>New in v{{ $version }}</a
|
||||||
|
>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -3,7 +3,7 @@ publish = "public"
|
||||||
command = "hugo --gc --minify"
|
command = "hugo --gc --minify"
|
||||||
|
|
||||||
[context.production.environment]
|
[context.production.environment]
|
||||||
HUGO_VERSION = "0.111.3"
|
HUGO_VERSION = "0.112.3"
|
||||||
HUGO_ENV = "production"
|
HUGO_ENV = "production"
|
||||||
HUGO_ENABLEGITINFO = "true"
|
HUGO_ENABLEGITINFO = "true"
|
||||||
|
|
||||||
|
@ -11,20 +11,20 @@ HUGO_ENABLEGITINFO = "true"
|
||||||
command = "hugo --gc --minify --enableGitInfo"
|
command = "hugo --gc --minify --enableGitInfo"
|
||||||
|
|
||||||
[context.split1.environment]
|
[context.split1.environment]
|
||||||
HUGO_VERSION = "0.111.3"
|
HUGO_VERSION = "0.112.3"
|
||||||
HUGO_ENV = "production"
|
HUGO_ENV = "production"
|
||||||
|
|
||||||
[context.deploy-preview]
|
[context.deploy-preview]
|
||||||
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
|
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
|
||||||
|
|
||||||
[context.deploy-preview.environment]
|
[context.deploy-preview.environment]
|
||||||
HUGO_VERSION = "0.111.3"
|
HUGO_VERSION = "0.112.3"
|
||||||
|
|
||||||
[context.branch-deploy]
|
[context.branch-deploy]
|
||||||
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
|
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
|
||||||
|
|
||||||
[context.branch-deploy.environment]
|
[context.branch-deploy.environment]
|
||||||
HUGO_VERSION = "0.111.3"
|
HUGO_VERSION = "0.112.3"
|
||||||
|
|
||||||
[context.next.environment]
|
[context.next.environment]
|
||||||
HUGO_ENABLEGITINFO = "true"
|
HUGO_ENABLEGITINFO = "true"
|
||||||
|
|
Loading…
Reference in a new issue