From: Bjørn Erik Pedersen Date: Wed, 11 Dec 2024 08:53:33 +0000 (+0100) Subject: Squashed 'docs/' changes from 227aab619..8390a4a3a X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e477373487abcccdbed95688e37aa74b9b8fc198;p=brevno-suite%2Fhugo Squashed 'docs/' changes from 227aab619..8390a4a3a 8390a4a3a Add Void Linux installation instructions d6099aae8 Update link to PostCSS plugins 25dad4693 netlify: Hugo 0.139.4 2b1fa118c Fix typo 3ef1eb505 Update hosting-on-aws-amplify c0f6d35d6 Fix typo aa54d4301 Correct directory name 98aa26bdb Improve instructions for hosting with AWS Amplify a07638a80 Add new-in badges 6ad018055 netlify: Hugo 0.139.3 1050835d6 Update title of hugo.Store page ebbd2e851 Clarify the shortcode Ordinal method b7716ed95 Revise code block render hook for Mermaid diagrams f1da9b6ea netlify: Hugo 0.139.2 d8ac9f428 Downgrade the Go toolchain in go.mod to a slightly older Go version 254b3c4f2 netlify: Hugo 0.139.1 03e666038 Add hugo.Store, site.Store and Shortcode.Store 157e8983b Update Anchorize.md 59fa9f214 Document the PageRef menu entry method bda544cce docs(transform.Unmarshal): match lang attribute to title language in examples 1985886bd Adjust front matter of shared Markdown snippets da5bd70d1 Fix typo 431b65d6b Update theme b63ef69f5 Update style guidance d50ed3422 Remove old new-in badges 12bfb9933 Update docs.yaml 0b936cacd netlify: Hugo 0.139.0 ab7668b4d dartsass: Add silenceDeprecations option 154df9bfc Merge commit '838bd312b1a287bb33962ad478dbc54737654f35' efa80477c docs: Regen CLI docs ad99e4a7a docs: Regenerate CLI docs git-subtree-dir: docs git-subtree-split: 8390a4a3ac36094f4cf47170af23b636608c420e --- diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.html index a41e45a2c..113e63973 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.html @@ -22,8 +22,15 @@ {{ $releases = where $releases "draft" false }} {{ $releases = where $releases "prerelease" false }} {{ range $releases | first 20 }} + {{ $publishDate := .published_at | time.AsTime }} + + {{/* Correct the v0.138.0 release date. See https://github.com/gohugoio/hugo/issues/13066. */}} + {{ if eq .name "v0.138.0" }} + {{ $publishDate = "2024-11-06T11:22:34Z" | time.AsTime }} + {{ end }} + {{ $ctx := dict - "Date" (.published_at | time.AsTime) + "Date" $publishDate "Title" (printf "Release %s" .name) "Permalink" .html_url "Section" "news" diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.xml b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.xml index 40bca59eb..26b1217d0 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.xml +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/news/list.xml @@ -21,14 +21,21 @@ {{- $releases = where $releases "draft" false }} {{- $releases = where $releases "prerelease" false }} {{- range $releases | first 20 }} + {{- $publishDate := .published_at | time.AsTime }} + + {{- /* Correct the v0.138.0 release date. See https://github.com/gohugoio/hugo/issues/13066. */}} + {{- if eq .name "v0.138.0" }} + {{- $publishDate = "2024-11-06T11:22:34Z" | time.AsTime }} + {{- end }} + {{- $summary := printf "Hugo %s was released on %s. See [release notes](%s) for details." .tag_name - (.published_at | time.AsTime | time.Format "2 Jan 2006") + ($publishDate | time.AsTime | time.Format "2 Jan 2006") .html_url }} {{- $ctx := dict - "PublishDate" (.published_at | time.AsTime) + "PublishDate" $publishDate "Title" (printf "Release %s" .name) "Permalink" .html_url "Section" "news" diff --git a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/related.html b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/related.html index ff7435668..53995a486 100644 --- a/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/related.html +++ b/_vendor/github.com/gohugoio/gohugoioTheme/layouts/partials/related.html @@ -16,7 +16,7 @@

{{ $heading }}

{{- end }} diff --git a/_vendor/modules.txt b/_vendor/modules.txt index 0a5950790..5ff5b9db1 100644 --- a/_vendor/modules.txt +++ b/_vendor/modules.txt @@ -1 +1,2 @@ -# github.com/gohugoio/gohugoioTheme v0.0.0-20241105120803-6c6e5fb8f8af +# github.com/gohugoio/gohugoioTheme v0.0.0-20241119115653-b92d27ede3e1 + diff --git a/content/en/commands/hugo.md b/content/en/commands/hugo.md index c23b3e4ba..ef0bca9a5 100644 --- a/content/en/commands/hugo.md +++ b/content/en/commands/hugo.md @@ -33,7 +33,6 @@ hugo [flags] --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") -c, --contentDir string filesystem path to content directory - --debug debug output -d, --destination string filesystem path to write files to --disableKinds strings disable different kind of pages (home, RSS etc.) --enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages @@ -64,7 +63,6 @@ hugo [flags] -t, --theme strings themes to use (located in /themes/THEMENAME/) --themesDir string filesystem path to themes directory --trace file write trace to file (not useful in general) - -v, --verbose verbose output -w, --watch watch filesystem for changes and recreate as needed ``` diff --git a/content/en/commands/hugo_build.md b/content/en/commands/hugo_build.md index c0abecfa9..582cbe511 100644 --- a/content/en/commands/hugo_build.md +++ b/content/en/commands/hugo_build.md @@ -33,7 +33,6 @@ hugo build [flags] --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") -c, --contentDir string filesystem path to content directory - --debug debug output -d, --destination string filesystem path to write files to --disableKinds strings disable different kind of pages (home, RSS etc.) --enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages @@ -64,7 +63,6 @@ hugo build [flags] -t, --theme strings themes to use (located in /themes/THEMENAME/) --themesDir string filesystem path to themes directory --trace file write trace to file (not useful in general) - -v, --verbose verbose output -w, --watch watch filesystem for changes and recreate as needed ``` diff --git a/content/en/commands/hugo_completion.md b/content/en/commands/hugo_completion.md index 171018fee..96f53742a 100644 --- a/content/en/commands/hugo_completion.md +++ b/content/en/commands/hugo_completion.md @@ -25,7 +25,6 @@ See each sub-command's help for details on how to use the generated script. --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -34,7 +33,6 @@ See each sub-command's help for details on how to use the generated script. -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_completion_bash.md b/content/en/commands/hugo_completion_bash.md index bface97c6..60973415f 100644 --- a/content/en/commands/hugo_completion_bash.md +++ b/content/en/commands/hugo_completion_bash.md @@ -48,7 +48,6 @@ hugo completion bash --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -57,7 +56,6 @@ hugo completion bash -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_completion_fish.md b/content/en/commands/hugo_completion_fish.md index 3a9cf0df2..92bbd6c22 100644 --- a/content/en/commands/hugo_completion_fish.md +++ b/content/en/commands/hugo_completion_fish.md @@ -39,7 +39,6 @@ hugo completion fish [flags] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -48,7 +47,6 @@ hugo completion fish [flags] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_completion_powershell.md b/content/en/commands/hugo_completion_powershell.md index 593573cee..f01442920 100644 --- a/content/en/commands/hugo_completion_powershell.md +++ b/content/en/commands/hugo_completion_powershell.md @@ -36,7 +36,6 @@ hugo completion powershell [flags] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -45,7 +44,6 @@ hugo completion powershell [flags] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_completion_zsh.md b/content/en/commands/hugo_completion_zsh.md index c227c6125..142c53103 100644 --- a/content/en/commands/hugo_completion_zsh.md +++ b/content/en/commands/hugo_completion_zsh.md @@ -50,7 +50,6 @@ hugo completion zsh [flags] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -59,7 +58,6 @@ hugo completion zsh [flags] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_config.md b/content/en/commands/hugo_config.md index 96f84a531..8e8d745d2 100644 --- a/content/en/commands/hugo_config.md +++ b/content/en/commands/hugo_config.md @@ -34,7 +34,6 @@ hugo config [command] [flags] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -43,7 +42,6 @@ hugo config [command] [flags] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_config_mounts.md b/content/en/commands/hugo_config_mounts.md index 6fa30c016..5af4819a2 100644 --- a/content/en/commands/hugo_config_mounts.md +++ b/content/en/commands/hugo_config_mounts.md @@ -28,7 +28,6 @@ hugo config mounts [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -37,7 +36,6 @@ hugo config mounts [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_convert.md b/content/en/commands/hugo_convert.md index 53d4d992c..aeaa37766 100644 --- a/content/en/commands/hugo_convert.md +++ b/content/en/commands/hugo_convert.md @@ -27,7 +27,6 @@ See convert's subcommands toJSON, toTOML and toYAML for more information. --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -36,7 +35,6 @@ See convert's subcommands toJSON, toTOML and toYAML for more information. -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_convert_toJSON.md b/content/en/commands/hugo_convert_toJSON.md index 9546788b5..40403193c 100644 --- a/content/en/commands/hugo_convert_toJSON.md +++ b/content/en/commands/hugo_convert_toJSON.md @@ -28,7 +28,6 @@ hugo convert toJSON [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -39,7 +38,6 @@ hugo convert toJSON [flags] [args] -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory --unsafe enable less safe operations, please backup first - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_convert_toTOML.md b/content/en/commands/hugo_convert_toTOML.md index 3bd703f60..53ab82651 100644 --- a/content/en/commands/hugo_convert_toTOML.md +++ b/content/en/commands/hugo_convert_toTOML.md @@ -28,7 +28,6 @@ hugo convert toTOML [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -39,7 +38,6 @@ hugo convert toTOML [flags] [args] -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory --unsafe enable less safe operations, please backup first - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_convert_toYAML.md b/content/en/commands/hugo_convert_toYAML.md index 563375486..efb63a4e2 100644 --- a/content/en/commands/hugo_convert_toYAML.md +++ b/content/en/commands/hugo_convert_toYAML.md @@ -28,7 +28,6 @@ hugo convert toYAML [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -39,7 +38,6 @@ hugo convert toYAML [flags] [args] -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory --unsafe enable less safe operations, please backup first - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_deploy.md b/content/en/commands/hugo_deploy.md index a6fc53658..fce1e5422 100644 --- a/content/en/commands/hugo_deploy.md +++ b/content/en/commands/hugo_deploy.md @@ -38,7 +38,6 @@ hugo deploy [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -47,7 +46,6 @@ hugo deploy [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_env.md b/content/en/commands/hugo_env.md index 50a7bc92f..e216be416 100644 --- a/content/en/commands/hugo_env.md +++ b/content/en/commands/hugo_env.md @@ -27,7 +27,6 @@ hugo env [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -36,7 +35,6 @@ hugo env [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_gen.md b/content/en/commands/hugo_gen.md index 20d829178..97cdbdb9d 100644 --- a/content/en/commands/hugo_gen.md +++ b/content/en/commands/hugo_gen.md @@ -23,7 +23,6 @@ Generate documentation for your project using Hugo's documentation engine, inclu --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -32,7 +31,6 @@ Generate documentation for your project using Hugo's documentation engine, inclu -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_gen_chromastyles.md b/content/en/commands/hugo_gen_chromastyles.md index 1c0ac7235..49cde6bb9 100644 --- a/content/en/commands/hugo_gen_chromastyles.md +++ b/content/en/commands/hugo_gen_chromastyles.md @@ -33,7 +33,6 @@ hugo gen chromastyles [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -42,7 +41,6 @@ hugo gen chromastyles [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_gen_doc.md b/content/en/commands/hugo_gen_doc.md index 5d2fffa4f..180dc4f95 100644 --- a/content/en/commands/hugo_gen_doc.md +++ b/content/en/commands/hugo_gen_doc.md @@ -33,7 +33,6 @@ hugo gen doc [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -42,7 +41,6 @@ hugo gen doc [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_gen_man.md b/content/en/commands/hugo_gen_man.md index f05b06298..f33342c54 100644 --- a/content/en/commands/hugo_gen_man.md +++ b/content/en/commands/hugo_gen_man.md @@ -30,7 +30,6 @@ hugo gen man [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -39,7 +38,6 @@ hugo gen man [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_import.md b/content/en/commands/hugo_import.md index 7de28e4cb..b20b58599 100644 --- a/content/en/commands/hugo_import.md +++ b/content/en/commands/hugo_import.md @@ -25,7 +25,6 @@ Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_p --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -34,7 +33,6 @@ Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_p -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_import_jekyll.md b/content/en/commands/hugo_import_jekyll.md index 33c91d24c..14c57cc44 100644 --- a/content/en/commands/hugo_import_jekyll.md +++ b/content/en/commands/hugo_import_jekyll.md @@ -30,7 +30,6 @@ hugo import jekyll [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -39,7 +38,6 @@ hugo import jekyll [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_list.md b/content/en/commands/hugo_list.md index 070a44d84..726fe51a9 100644 --- a/content/en/commands/hugo_list.md +++ b/content/en/commands/hugo_list.md @@ -25,7 +25,6 @@ List requires a subcommand, e.g. hugo list drafts --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -34,7 +33,6 @@ List requires a subcommand, e.g. hugo list drafts -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_list_all.md b/content/en/commands/hugo_list_all.md index 5dd29904e..59846733d 100644 --- a/content/en/commands/hugo_list_all.md +++ b/content/en/commands/hugo_list_all.md @@ -27,7 +27,6 @@ hugo list all [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -36,7 +35,6 @@ hugo list all [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_list_drafts.md b/content/en/commands/hugo_list_drafts.md index 4dff70886..5f3bcd617 100644 --- a/content/en/commands/hugo_list_drafts.md +++ b/content/en/commands/hugo_list_drafts.md @@ -27,7 +27,6 @@ hugo list drafts [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -36,7 +35,6 @@ hugo list drafts [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_list_expired.md b/content/en/commands/hugo_list_expired.md index 7b874a105..c010d1159 100644 --- a/content/en/commands/hugo_list_expired.md +++ b/content/en/commands/hugo_list_expired.md @@ -27,7 +27,6 @@ hugo list expired [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -36,7 +35,6 @@ hugo list expired [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_list_future.md b/content/en/commands/hugo_list_future.md index f558acd52..888784dcd 100644 --- a/content/en/commands/hugo_list_future.md +++ b/content/en/commands/hugo_list_future.md @@ -27,7 +27,6 @@ hugo list future [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -36,7 +35,6 @@ hugo list future [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_list_published.md b/content/en/commands/hugo_list_published.md index 9fc75694b..b8ec0e7b2 100644 --- a/content/en/commands/hugo_list_published.md +++ b/content/en/commands/hugo_list_published.md @@ -27,7 +27,6 @@ hugo list published [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -36,7 +35,6 @@ hugo list published [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_mod.md b/content/en/commands/hugo_mod.md index d4e305ff1..2c07b89cf 100644 --- a/content/en/commands/hugo_mod.md +++ b/content/en/commands/hugo_mod.md @@ -34,7 +34,6 @@ See https://gohugo.io/hugo-modules/ for more information. --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -43,7 +42,6 @@ See https://gohugo.io/hugo-modules/ for more information. -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_mod_clean.md b/content/en/commands/hugo_mod_clean.md index 80a983a66..7df51059f 100644 --- a/content/en/commands/hugo_mod_clean.md +++ b/content/en/commands/hugo_mod_clean.md @@ -34,7 +34,6 @@ hugo mod clean [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -43,7 +42,6 @@ hugo mod clean [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_mod_get.md b/content/en/commands/hugo_mod_get.md index de6b01a24..f4ca6069a 100644 --- a/content/en/commands/hugo_mod_get.md +++ b/content/en/commands/hugo_mod_get.md @@ -58,7 +58,6 @@ hugo mod get [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -67,7 +66,6 @@ hugo mod get [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_mod_graph.md b/content/en/commands/hugo_mod_graph.md index f20e26b6f..5b5a14d5d 100644 --- a/content/en/commands/hugo_mod_graph.md +++ b/content/en/commands/hugo_mod_graph.md @@ -35,7 +35,6 @@ hugo mod graph [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -44,7 +43,6 @@ hugo mod graph [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_mod_init.md b/content/en/commands/hugo_mod_init.md index 1d7bc4ac0..bf9651b59 100644 --- a/content/en/commands/hugo_mod_init.md +++ b/content/en/commands/hugo_mod_init.md @@ -39,7 +39,6 @@ hugo mod init [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -48,7 +47,6 @@ hugo mod init [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_mod_npm.md b/content/en/commands/hugo_mod_npm.md index eeb684e51..a013fb91f 100644 --- a/content/en/commands/hugo_mod_npm.md +++ b/content/en/commands/hugo_mod_npm.md @@ -27,7 +27,6 @@ hugo mod npm [command] [flags] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -36,7 +35,6 @@ hugo mod npm [command] [flags] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_mod_npm_pack.md b/content/en/commands/hugo_mod_npm_pack.md index 47d3e28b9..8f8738280 100644 --- a/content/en/commands/hugo_mod_npm_pack.md +++ b/content/en/commands/hugo_mod_npm_pack.md @@ -42,7 +42,6 @@ hugo mod npm pack [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -51,7 +50,6 @@ hugo mod npm pack [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_mod_tidy.md b/content/en/commands/hugo_mod_tidy.md index be0f92657..c15ddb3c8 100644 --- a/content/en/commands/hugo_mod_tidy.md +++ b/content/en/commands/hugo_mod_tidy.md @@ -28,7 +28,6 @@ hugo mod tidy [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -37,7 +36,6 @@ hugo mod tidy [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_mod_vendor.md b/content/en/commands/hugo_mod_vendor.md index d33b2a673..ae112a36a 100644 --- a/content/en/commands/hugo_mod_vendor.md +++ b/content/en/commands/hugo_mod_vendor.md @@ -34,7 +34,6 @@ hugo mod vendor [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -43,7 +42,6 @@ hugo mod vendor [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_mod_verify.md b/content/en/commands/hugo_mod_verify.md index c5e755e3c..63dd28ce8 100644 --- a/content/en/commands/hugo_mod_verify.md +++ b/content/en/commands/hugo_mod_verify.md @@ -33,7 +33,6 @@ hugo mod verify [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -42,7 +41,6 @@ hugo mod verify [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_new.md b/content/en/commands/hugo_new.md index cfe6cc1cd..4d3021b44 100644 --- a/content/en/commands/hugo_new.md +++ b/content/en/commands/hugo_new.md @@ -30,7 +30,6 @@ Ensure you run this within the root directory of your site. --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -39,7 +38,6 @@ Ensure you run this within the root directory of your site. -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_new_content.md b/content/en/commands/hugo_new_content.md index c1e3ffa30..a8d2100f9 100644 --- a/content/en/commands/hugo_new_content.md +++ b/content/en/commands/hugo_new_content.md @@ -42,7 +42,6 @@ hugo new content [path] [flags] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -51,7 +50,6 @@ hugo new content [path] [flags] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_new_site.md b/content/en/commands/hugo_new_site.md index 9df879103..cc0e63013 100644 --- a/content/en/commands/hugo_new_site.md +++ b/content/en/commands/hugo_new_site.md @@ -31,7 +31,6 @@ hugo new site [path] [flags] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -40,7 +39,6 @@ hugo new site [path] [flags] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_new_theme.md b/content/en/commands/hugo_new_theme.md index 6ab98f6b9..a79978c4a 100644 --- a/content/en/commands/hugo_new_theme.md +++ b/content/en/commands/hugo_new_theme.md @@ -30,7 +30,6 @@ hugo new theme [name] [flags] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -39,7 +38,6 @@ hugo new theme [name] [flags] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_server.md b/content/en/commands/hugo_server.md index b79b7f374..a1c77d36f 100644 --- a/content/en/commands/hugo_server.md +++ b/content/en/commands/hugo_server.md @@ -54,6 +54,7 @@ hugo server [command] [flags] --noChmod don't sync permission mode of files --noHTTPCache prevent HTTP caching --noTimes don't sync modification time of files + -O, --openBrowser open the site in a browser after server startup --panicOnWarning panic on first WARNING log --poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes -p, --port int port on which the server will listen (default 1313) @@ -80,7 +81,6 @@ hugo server [command] [flags] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -89,7 +89,6 @@ hugo server [command] [flags] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_server_trust.md b/content/en/commands/hugo_server_trust.md index fb242d88c..1a904e845 100644 --- a/content/en/commands/hugo_server_trust.md +++ b/content/en/commands/hugo_server_trust.md @@ -24,7 +24,6 @@ hugo server trust [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -33,7 +32,6 @@ hugo server trust [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/commands/hugo_version.md b/content/en/commands/hugo_version.md index bbc961093..b1a6b971e 100644 --- a/content/en/commands/hugo_version.md +++ b/content/en/commands/hugo_version.md @@ -27,7 +27,6 @@ hugo version [flags] [args] --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00 --config string config file (default is hugo.yaml|json|toml) --configDir string config dir (default "config") - --debug debug output -d, --destination string filesystem path to write files to -e, --environment string build environment --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern @@ -36,7 +35,6 @@ hugo version [flags] [args] -M, --renderToMemory render to memory (mostly useful when running the server) -s, --source string filesystem path to read files relative from --themesDir string filesystem path to themes directory - -v, --verbose verbose output ``` ### SEE ALSO diff --git a/content/en/content-management/_common/page-kinds.md b/content/en/content-management/_common/page-kinds.md index 07a53e8e6..8f10dcd79 100644 --- a/content/en/content-management/_common/page-kinds.md +++ b/content/en/content-management/_common/page-kinds.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- | Kind | Description | Example | diff --git a/content/en/content-management/diagrams.md b/content/en/content-management/diagrams.md index 8851034c6..f9f3cd30f 100644 --- a/content/en/content-management/diagrams.md +++ b/content/en/content-management/diagrams.md @@ -52,7 +52,7 @@ Hugo does not provide a built-in template for Mermaid diagrams. Create your own {{< code file=layouts/_default/_markup/render-codeblock-mermaid.html >}}
-  {{- .Inner | safeHTML }}
+  {{- .Inner | htmlEscape | safeHTML }}
 
{{ .Page.Store.Set "hasMermaid" true }} {{< /code >}} diff --git a/content/en/contribute/documentation.md b/content/en/contribute/documentation.md index 580d0b0e2..d4e65c9e0 100644 --- a/content/en/contribute/documentation.md +++ b/content/en/contribute/documentation.md @@ -37,7 +37,9 @@ Please follow these guidelines: ### Style -Although we do not strictly adhere to the [Microsoft Writing Style Guide], it is an excellent resource for questions related to style, grammar, and voice. +Please adhere to Google's [developer documentation style guide]. + +[developer documentation style guide]: https://developers.google.com/style #### Terminology diff --git a/content/en/functions/_common/glob-patterns.md b/content/en/functions/_common/glob-patterns.md index 3b0813f6f..d3092dece 100644 --- a/content/en/functions/_common/glob-patterns.md +++ b/content/en/functions/_common/glob-patterns.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- Path|Pattern|Match diff --git a/content/en/functions/_common/go-html-template-package.md b/content/en/functions/_common/go-html-template-package.md index b622f2b76..57992ea66 100644 --- a/content/en/functions/_common/go-html-template-package.md +++ b/content/en/functions/_common/go-html-template-package.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- Hugo uses Go's [text/template] and [html/template] packages. diff --git a/content/en/functions/_common/locales.md b/content/en/functions/_common/locales.md index fd8415781..42d008776 100644 --- a/content/en/functions/_common/locales.md +++ b/content/en/functions/_common/locales.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- {{% note %}} diff --git a/content/en/functions/_common/regular-expressions.md b/content/en/functions/_common/regular-expressions.md index 48e020ac6..58f81a2ee 100644 --- a/content/en/functions/_common/regular-expressions.md +++ b/content/en/functions/_common/regular-expressions.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- When specifying the regular expression, use a raw [string literal] (backticks) instead of an interpreted string literal (double quotes) to simplify the syntax. With an interpreted string literal you must escape backslashes. diff --git a/content/en/functions/_common/time-layout-string.md b/content/en/functions/_common/time-layout-string.md index 827dc9894..3664eaef2 100644 --- a/content/en/functions/_common/time-layout-string.md +++ b/content/en/functions/_common/time-layout-string.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- Format a `time.Time` value based on [Go's reference time]: diff --git a/content/en/functions/css/PostCSS.md b/content/en/functions/css/PostCSS.md index 750971c10..8d4143575 100644 --- a/content/en/functions/css/PostCSS.md +++ b/content/en/functions/css/PostCSS.md @@ -124,6 +124,6 @@ module.exports = { ``` [node.js]: https://nodejs.org/en/download -[postcss plugins]: https://www.postcss.parts/ +[postcss plugins]: https://postcss.org/docs/postcss-plugins [supported file name]: https://github.com/postcss/postcss-load-config#usage [transpile to CSS]: /functions/css/sass/ diff --git a/content/en/functions/css/Sass.md b/content/en/functions/css/Sass.md index 328037bb9..793c0c1ac 100644 --- a/content/en/functions/css/Sass.md +++ b/content/en/functions/css/Sass.md @@ -86,6 +86,9 @@ includePaths {{ end }} ``` +silenceDeprecations +: (`slice`) {{< new-in 0.139.0 >}} A slice of deprecation IDs to silence. The deprecation IDs are printed to in the warning message, e.g "import" in `WARN Dart Sass: DEPRECATED [import] ...`. This is for Dart Sass only. + ## Dart Sass The extended version of Hugo includes [LibSass] to transpile Sass to CSS. In 2020, the Sass team deprecated LibSass in favor of [Dart Sass]. diff --git a/content/en/functions/fmt/_common/fmt-layout.md b/content/en/functions/fmt/_common/fmt-layout.md index ff69ce5e4..09a9ee867 100644 --- a/content/en/functions/fmt/_common/fmt-layout.md +++ b/content/en/functions/fmt/_common/fmt-layout.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- The documentation for Go's [fmt] package describes the structure and content of the format string. diff --git a/content/en/functions/go-template/_common/text-template.md b/content/en/functions/go-template/_common/text-template.md index 71718c3fd..4b934c1e9 100644 --- a/content/en/functions/go-template/_common/text-template.md +++ b/content/en/functions/go-template/_common/text-template.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- See Go's [text/template] documentation for more information. diff --git a/content/en/functions/go-template/_common/truthy-falsy.md b/content/en/functions/go-template/_common/truthy-falsy.md index c41bb6561..e15e58d61 100644 --- a/content/en/functions/go-template/_common/truthy-falsy.md +++ b/content/en/functions/go-template/_common/truthy-falsy.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- The falsy values are `false`, `0`, any `nil` pointer or interface value, any array, slice, map, or string of length zero, and zero `time.Time` values. diff --git a/content/en/functions/hugo/Store.md b/content/en/functions/hugo/Store.md new file mode 100644 index 000000000..b0503a5ff --- /dev/null +++ b/content/en/functions/hugo/Store.md @@ -0,0 +1,125 @@ +--- +title: hugo.Store +description: Returns a global, persistent "scratch pad" to store and manipulate data. +categories: [] +keywords: [] +action: + related: + - methods/page/store + - methods/site/store + - functions/collections/NewScratch + returnType: maps.Scratch + signatures: [hugo.Store] +toc: true +--- + +{{< new-in 0.139.0 >}} + +The global `hugo.Store` function creates a persistent [scratch pad] to store and manipulate data. To create a locally scoped, use the [`newScratch`] function. + +[`Scratch`]: /functions/hugo/scratch/ +[`newScratch`]: /functions/collections/newscratch/ +[scratch pad]: /getting-started/glossary/#scratch-pad + +## Methods + +###### Set + +Sets the value of a given key. + +```go-html-template +{{ hugo.Store.Set "greeting" "Hello" }} +``` + +###### Get + +Gets the value of a given key. + +```go-html-template +{{ hugo.Store.Set "greeting" "Hello" }} +{{ hugo.Store.Get "greeting" }} → Hello +``` + +###### Add + +Adds a given value to existing value(s) of the given key. + +For single values, `Add` accepts values that support Go's `+` operator. If the first `Add` for a key is an array or slice, the following adds will be appended to that list. + +```go-html-template +{{ hugo.Store.Set "greeting" "Hello" }} +{{ hugo.Store.Add "greeting" "Welcome" }} +{{ hugo.Store.Get "greeting" }} → HelloWelcome +``` + +```go-html-template +{{ hugo.Store.Set "total" 3 }} +{{ hugo.Store.Add "total" 7 }} +{{ hugo.Store.Get "total" }} → 10 +``` + +```go-html-template +{{ hugo.Store.Set "greetings" (slice "Hello") }} +{{ hugo.Store.Add "greetings" (slice "Welcome" "Cheers") }} +{{ hugo.Store.Get "greetings" }} → [Hello Welcome Cheers] +``` + +###### SetInMap + +Takes a `key`, `mapKey` and `value` and adds a map of `mapKey` and `value` to the given `key`. + +```go-html-template +{{ hugo.Store.SetInMap "greetings" "english" "Hello" }} +{{ hugo.Store.SetInMap "greetings" "french" "Bonjour" }} +{{ hugo.Store.Get "greetings" }} → map[english:Hello french:Bonjour] +``` + +###### DeleteInMap + +Takes a `key` and `mapKey` and removes the map of `mapKey` from the given `key`. + +```go-html-template +{{ hugo.Store.SetInMap "greetings" "english" "Hello" }} +{{ hugo.Store.SetInMap "greetings" "french" "Bonjour" }} +{{ hugo.Store.DeleteInMap "greetings" "english" }} +{{ hugo.Store.Get "greetings" }} → map[french:Bonjour] +``` + +###### GetSortedMapValues + +Returns an array of values from `key` sorted by `mapKey`. + +```go-html-template +{{ hugo.Store.SetInMap "greetings" "english" "Hello" }} +{{ hugo.Store.SetInMap "greetings" "french" "Bonjour" }} +{{ hugo.Store.GetSortedMapValues "greetings" }} → [Hello Bonjour] +``` + +###### Delete + +Removes the given key. + +```go-html-template +{{ hugo.Store.Set "greeting" "Hello" }} +{{ hugo.Store.Delete "greeting" }} +``` + +## Determinate values + +The `Store` method is often used to set scratch pad values within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the scratch pad values are indeterminate until Hugo renders the page content. + +If you need to access a scratch pad value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a [noop] variable: + +[noop]: /getting-started/glossary/#noop + +```go-html-template +{{ $noop := .Content }} +{{ hugo.Store.Get "mykey" }} +``` + +You can also trigger content rendering with the `ContentWithoutSummary`, `FuzzyWordCount`, `Len`, `Plain`, `PlainWords`, `ReadingTime`, `Summary`, `Truncated`, and `WordCount` methods. For example: + +```go-html-template +{{ $noop := .WordCount }} +{{ hugo.Store.Get "mykey" }} +``` diff --git a/content/en/functions/images/_common/apply-image-filter.md b/content/en/functions/images/_common/apply-image-filter.md index 15eddb485..08e08238f 100644 --- a/content/en/functions/images/_common/apply-image-filter.md +++ b/content/en/functions/images/_common/apply-image-filter.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- Apply the filter using the [`images.Filter`] function: diff --git a/content/en/functions/resources/_common/postcss-windows-warning.md b/content/en/functions/resources/_common/postcss-windows-warning.md index 1b72e74db..e2d97850b 100644 --- a/content/en/functions/resources/_common/postcss-windows-warning.md +++ b/content/en/functions/resources/_common/postcss-windows-warning.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- If you are a Windows user, and the path to your project contains a space, you must place the PostCSS configuration within the package.json file. See [this example] and issue [#7333]. diff --git a/content/en/functions/time/_common/parsable-date-time-strings.md b/content/en/functions/time/_common/parsable-date-time-strings.md index 6d1633a6f..92842767e 100644 --- a/content/en/functions/time/_common/parsable-date-time-strings.md +++ b/content/en/functions/time/_common/parsable-date-time-strings.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- Format|Time zone diff --git a/content/en/functions/transform/Unmarshal.md b/content/en/functions/transform/Unmarshal.md index 998152eb2..960332c44 100644 --- a/content/en/functions/transform/Unmarshal.md +++ b/content/en/functions/transform/Unmarshal.md @@ -230,7 +230,7 @@ Let's add a `lang` attribute to the `title` nodes of our RSS feed, and a namespa en-US - The Hunchback of Notre Dame + The Hunchback of Notre Dame Written by Victor Hugo 9780140443530 https://example.org/books/the-hunchback-of-notre-dame/ @@ -238,7 +238,7 @@ Let's add a `lang` attribute to the `title` nodes of our RSS feed, and a namespa https://example.org/books/the-hunchback-of-notre-dame/ - Les Misérables + Les Misérables Written by Victor Hugo 9780451419439 https://example.org/books/les-miserables/ @@ -266,7 +266,7 @@ Each item node looks like this: "pubDate": "Mon, 09 Oct 2023 09:27:12 -0700", "title": { "#text": "The Hunchback of Notre Dame", - "-lang": "fr" + "-lang": "en" } } ``` @@ -290,8 +290,8 @@ Hugo renders this to: ```html
    -
  • The Hunchback of Notre Dame (fr) 9780140443530
  • -
  • Les Misérables (en) 9780451419439
  • +
  • The Hunchback of Notre Dame (en) 9780140443530
  • +
  • Les Misérables (fr) 9780451419439
``` diff --git a/content/en/functions/urls/Anchorize.md b/content/en/functions/urls/Anchorize.md index f3939675a..d8866ae05 100644 --- a/content/en/functions/urls/Anchorize.md +++ b/content/en/functions/urls/Anchorize.md @@ -28,10 +28,10 @@ This controls the behavior of the `anchorize` function and the generation of hea Set `autoHeadingIDType` to one of: github -: Compatible with GitHub. This is the default, and strongly recommended. +: Compatible with GitHub. This is the default. github-ascii -: Similar to the "github" setting, but removes non-ASCII characters. +: Similar to the `github` setting, but removes non-ASCII characters. blackfriday : Provided for backwards compatibility with Hugo v0.59.1 and earlier. This option will be removed in a future release. diff --git a/content/en/functions/urls/_common/anchorize-vs-urlize.md b/content/en/functions/urls/_common/anchorize-vs-urlize.md index 718c14098..710a3c592 100644 --- a/content/en/functions/urls/_common/anchorize-vs-urlize.md +++ b/content/en/functions/urls/_common/anchorize-vs-urlize.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- The [`anchorize`] and [`urlize`] functions are similar: diff --git a/content/en/hosting-and-deployment/hosting-on-aws-amplify.md b/content/en/hosting-and-deployment/hosting-on-aws-amplify.md deleted file mode 100644 index 43d75312a..000000000 --- a/content/en/hosting-and-deployment/hosting-on-aws-amplify.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: Host on AWS Amplify -description: Develop and deploy a cloud-powered web app with AWS Amplify. -categories: [hosting and deployment] -keywords: [hosting,amplify] -menu: - docs: - parent: hosting-and-deployment -toc: true ---- - -In this guide we'll walk through how to deploy and host your Hugo site using the [AWS Amplify Console](https://console.amplify.aws). - -AWS Amplify is a combination of client library, CLI toolchain, and a Console for continuous deployment and hosting. The Amplify CLI and library allow developers to get up & running with full-stack cloud-powered applications with features like authentication, storage, serverless GraphQL or REST APIs, analytics, Lambda functions, & more. The Amplify Console provides continuous deployment and hosting for modern web apps (single page apps and static site generators). Continuous deployment allows developers to deploy updates to their web app on every code commit to their Git repository. Hosting includes features such as globally available CDNs, easy custom domain setup + HTTPS, feature branch deployments, and password protection. - -## Pre-requisites - -* [Sign up for an AWS Account](https://portal.aws.amazon.com/billing/signup?redirect_url=https%3A%2F%2Faws.amazon.com%2Fregistration-confirmation). There are no upfront charges or any term commitments to create an AWS account and signing up gives you immediate access to the AWS Free Tier. -* You have an account with GitHub, GitLab, or Bitbucket. -* You have completed the [Quick Start] or have a Hugo website you are ready to deploy and share with the world. - -## Hosting - -1. Log in to the [AWS Amplify Console](https://console.aws.amazon.com/amplify/home) and choose Get Started under Deploy. - ![Hugo Amplify](/images/hosting-and-deployment/hosting-on-aws-amplify/amplify-gettingstarted.png) - -1. Connect a branch from your GitHub, Bitbucket, GitLab, or AWS CodeCommit repository. Connecting your repository allows Amplify to deploy updates on every code commit to a branch. - ![Hugo Amplify](/images/hosting-and-deployment/hosting-on-aws-amplify/amplify-connect-repo.gif) - -1. Accept the default build settings. The Amplify Console automatically detects your Hugo build settings and output directory. - ![Hugo Amplify](/images/hosting-and-deployment/hosting-on-aws-amplify/amplify-build-settings.png) - -1. Review your changes and then choose **Save and deploy**. The Amplify Console will pull code from your repository, build changes to the backend and frontend, and deploy your build artifacts at `https://master.unique-id.amplifyapp.com`. Bonus: Screenshots of your app on different devices to find layout issues. - -## Using a newer version of Hugo - -If you need to use a different, perhaps newer, version of Hugo than the version currently supported by AWS Amplify: - -1. Visit the [AWS Amplify Console](https://console.aws.amazon.com/amplify/home), and click the app you would like to modify -1. In the side navigation bar, Under App Settings, click **Build settings** -1. On the Build settings page, near the bottom, there is a section called **Build image settings**. Click **Edit** -1. Under **Live package updates**, click **Add package version override** -1. From the selection, click **Hugo** and ensure the version field says `latest` -1. Click **Save** to save the changes. - -[Quick Start]: /getting-started/quick-start/ diff --git a/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-05.png b/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-05.png new file mode 100644 index 000000000..bb98d974a Binary files /dev/null and b/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-05.png differ diff --git a/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-06.png b/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-06.png new file mode 100644 index 000000000..2e9b96e2b Binary files /dev/null and b/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-06.png differ diff --git a/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-07.png b/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-07.png new file mode 100644 index 000000000..b3260157b Binary files /dev/null and b/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-07.png differ diff --git a/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-08.png b/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-08.png new file mode 100644 index 000000000..55e80e710 Binary files /dev/null and b/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-08.png differ diff --git a/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-09.png b/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-09.png new file mode 100644 index 000000000..b422e3ad6 Binary files /dev/null and b/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-09.png differ diff --git a/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-11.png b/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-11.png new file mode 100644 index 000000000..e147edfb9 Binary files /dev/null and b/content/en/hosting-and-deployment/hosting-on-aws-amplify/amplify-step-11.png differ diff --git a/content/en/hosting-and-deployment/hosting-on-aws-amplify/index.md b/content/en/hosting-and-deployment/hosting-on-aws-amplify/index.md new file mode 100644 index 000000000..b1a0f468c --- /dev/null +++ b/content/en/hosting-and-deployment/hosting-on-aws-amplify/index.md @@ -0,0 +1,151 @@ +--- +title: Host on AWS Amplify +description: Host your site on AWS Amplify with continuous deployment. +categories: [hosting and deployment] +keywords: [hosting] +menu: + docs: + parent: hosting-and-deployment +toc: true +--- + +## Prerequisites + +Please complete the following tasks before continuing: + +1. [Create an AWS account] +2. [Install Git] +3. [Create a Hugo site] and test it locally with `hugo server` +4. Commit the changes to your local repository +5. Push the local repository to your [GitHub], [GitLab], or [Bitbucket] account + +[Bitbucket]: https://bitbucket.org/product +[Create a Hugo site]: /getting-started/quick-start/ +[Create an AWS account]: https://aws.amazon.com/resources/create-account/ +[GitHub]: https://github.com +[GitLab]: https://about.gitlab.com/ +[Install Git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git + +## Procedure + +This procedure will enable continuous deployment from a GitHub repository. The procedure is essentially the same if you are using GitLab or Bitbucket. + +Step 1 +: Create a file named `amplify.yml` in the root of your project. + +```sh +touch amplify.yml +``` + +Step 2 +: Copy and paste the YAML below into the file you created. Change the application versions and time zone as needed. + +{{< code file=amplify.yml copy=true >}} +version: 1 +env: + variables: + # Application versions + DART_SASS_VERSION: 1.81.0 + GO_VERSION: 1.23.3 + HUGO_VERSION: 0.139.3 + # Time zone + TZ: America/Los_Angeles + # Cache + HUGO_CACHEDIR: ${PWD}/.hugo + NPM_CONFIG_CACHE: ${PWD}/.npm +frontend: + phases: + preBuild: + commands: + # Install Dart Sass + - curl -LJO https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz + - sudo tar -C /usr/local/bin -xf dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz + - rm dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz + - export PATH=/usr/local/bin/dart-sass:$PATH + + # Install Go + - curl -LJO https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz + - sudo tar -C /usr/local -xf go${GO_VERSION}.linux-amd64.tar.gz + - rm go${GO_VERSION}.linux-amd64.tar.gz + - export PATH=/usr/local/go/bin:$PATH + + # Install Hugo + - curl -LJO https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz + - sudo tar -C /usr/local/bin -xf hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz + - rm hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz + - export PATH=/usr/local/bin:$PATH + + # Check installed versions + - go version + - hugo version + - node -v + - npm -v + - sass --embedded --version + + # Install Node.JS dependencies + - "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci --prefer-offline || true" + + # https://github.com/gohugoio/hugo/issues/9810 + - git config --add core.quotepath false + build: + commands: + - hugo --gc --minify + artifacts: + baseDirectory: public + files: + - '**/*' + cache: + paths: + - ${HUGO_CACHEDIR}/**/* + - ${NPM_CONFIG_CACHE}/**/* +{{< /code >}} + +Step 3 +: Commit and push the change to your GitHub repository. + +```sh +git add -A +git commit -m "Create amplify.yml" +git push +``` + +Step 4 +: Log in to your AWS account, navigate to the [Amplify Console], then press the **Deploy an app** button. + +[Amplify Console]: https://console.aws.amazon.com/amplify/apps + +Step 5 +: Choose a source code provider, then press the **Next** button. + + ![screen capture](amplify-step-05.png) + +Step 6 +: Authorize AWS Amplify to access your GitHub account. + + ![screen capture](amplify-step-06.png) + +Step 7 +: Select your personal account or relevant organization. + + ![screen capture](amplify-step-07.png) + +Step 8 +: Authorize access to one or more repositories. + + ![screen capture](amplify-step-08.png) + +Step 9 +: Select a repository and branch, then press the **Next** button. + + ![screen capture](amplify-step-09.png) + +Step 10 +: On the "App settings" page, scroll to the bottom then press the **Next** button. Amplify reads the `amplify.yml` file you created in Steps 1-3 instead of using the values on this page. + +Step 11 +: On the "Review" page, scroll to the bottom then press the **Save and deploy** button. + +Step 12 +: When your site has finished deploying, press the **Visit deployed URL** button to view your published site. + + ![screen capture](amplify-step-11.png) diff --git a/content/en/hosting-and-deployment/hosting-on-github/index.md b/content/en/hosting-and-deployment/hosting-on-github/index.md index 28c5ff841..45adeda1f 100644 --- a/content/en/hosting-and-deployment/hosting-on-github/index.md +++ b/content/en/hosting-and-deployment/hosting-on-github/index.md @@ -12,6 +12,8 @@ aliases: [/tutorials/github-pages-blog/] ## Prerequisites +Please complete the following tasks before continuing: + 1. [Create a GitHub account] 2. [Install Git] 3. [Create a Hugo site] and test it locally with `hugo server`. @@ -53,10 +55,11 @@ Step 4 {style="max-width: 280px"} Step 5 -: Create an empty file in your local repository. +: Create a file named `hugo.yaml` in a directory named `.github/workflows`. ```text -.github/workflows/hugo.yaml +mkdir -p .github/workflows +touch hugo.yaml ``` Step 6 @@ -144,7 +147,13 @@ jobs: {{< /code >}} Step 7 -: Commit the change to your local repository with a commit message of something like "Add workflow", and push to GitHub. +: Commit and push the change to your GitHub repository. + +```sh +git add -A +git commit -m "Create hugo.yaml" +git push +``` Step 8 : From GitHub's main menu, choose **Actions**. You will see something like this: @@ -181,7 +190,7 @@ You may remove this step if your site, themes, and modules do not transpile Sass [Dart Sass]: /hugo-pipes/transpile-sass-to-css/#dart-sass -## Additional resources +## Other resources - [Learn more about GitHub Actions](https://docs.github.com/en/actions) - [Caching dependencies to speed up workflows](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows) diff --git a/content/en/hosting-and-deployment/hosting-on-netlify/index.md b/content/en/hosting-and-deployment/hosting-on-netlify/index.md index a63451062..361a40e80 100644 --- a/content/en/hosting-and-deployment/hosting-on-netlify/index.md +++ b/content/en/hosting-and-deployment/hosting-on-netlify/index.md @@ -11,11 +11,13 @@ toc: true ## Prerequisites +Please complete the following tasks before continuing: + 1. [Create a Netlify account] 2. [Install Git] 3. [Create a Hugo site] and test it locally with `hugo server` 4. Commit the changes to your local repository -4. Push the local repository to your [GitHub], [GitLab], or [Bitbucket] account +5. Push the local repository to your [GitHub], [GitLab], or [Bitbucket] account [Bitbucket]: https://bitbucket.org/product [Create a Hugo site]: /getting-started/quick-start/ @@ -34,64 +36,64 @@ Step 1 Step 2 : Select your deployment method. -![screen capture](netlify-step-02.png) + ![screen capture](netlify-step-02.png) Step 3 : Authorize Netlify to connect with your GitHub account by pressing the **Authorize Netlify** button. -![screen capture](netlify-step-03.png) + ![screen capture](netlify-step-03.png) Step 4 : Press the **Configure Netlify on GitHub** button. -![screen capture](netlify-step-04.png) + ![screen capture](netlify-step-04.png) Step 5 : Install the Netlify app by selecting your GitHub account. -![screen capture](netlify-step-05.png) + ![screen capture](netlify-step-05.png) Step 6 : Press the **Install** button. -![screen capture](netlify-step-06.png) + ![screen capture](netlify-step-06.png) Step 7 : Click on the site's repository from the list. -![screen capture](netlify-step-07.png) + ![screen capture](netlify-step-07.png) Step 8 : Set the site name and branch from which to deploy. -![screen capture](netlify-step-08.png) + ![screen capture](netlify-step-08.png) Step 9 : Define the build settings, press the **Add environment variables** button, then press the **New variable** button. -![screen capture](netlify-step-09.png) + ![screen capture](netlify-step-09.png) Step 10 : Create a new environment variable named `HUGO_VERSION` and set the value to the [latest version]. [latest version]: https://github.com/gohugoio/hugo/releases/latest -![screen capture](netlify-step-10.png) + ![screen capture](netlify-step-10.png) Step 11 : Press the "Deploy my new site" button at the bottom of the page. -![screen capture](netlify-step-11.png) + ![screen capture](netlify-step-11.png) Step 12 : At the bottom of the screen, wait for the deploy to complete, then click on the deploy log entry. -![screen capture](netlify-step-12.png) + ![screen capture](netlify-step-12.png) Step 13 : Press the **Open production deploy** button to view the live site. -![screen capture](netlify-step-13.png) + ![screen capture](netlify-step-13.png) ## Configuration file diff --git a/content/en/hugo-modules/use-modules.md b/content/en/hugo-modules/use-modules.md index 913e4f775..d14379a10 100644 --- a/content/en/hugo-modules/use-modules.md +++ b/content/en/hugo-modules/use-modules.md @@ -133,8 +133,6 @@ Also see the [CLI Doc](/commands/hugo_mod_clean/). ## Module workspaces -{{< new-in 0.109.0 >}} - Workspace support was added in [Go 1.18](https://go.dev/blog/get-familiar-with-workspaces) and Hugo got solid support for it in the `v0.109.0` version. A common use case for a workspace is to simplify local development of a site with its theme modules. diff --git a/content/en/hugo-pipes/postprocess.md b/content/en/hugo-pipes/postprocess.md index cf99049fe..57c71e8ab 100755 --- a/content/en/hugo-pipes/postprocess.md +++ b/content/en/hugo-pipes/postprocess.md @@ -88,7 +88,7 @@ HUGO_ENVIRONMENT : The value e.g. set with `hugo -e production` (defaults to `production` for `hugo` and `development` for `hugo server`). HUGO_PUBLISHDIR -: {{< new-in 0.109.0 >}} The absolute path to the publish directory (the `public` directory). Note that the value will always point to a directory on disk even when running `hugo server` in memory mode. If you write to this folder from PostCSS when running the server, you could run the server with one of these flags: +: The absolute path to the publish directory (the `public` directory). Note that the value will always point to a directory on disk even when running `hugo server` in memory mode. If you write to this folder from PostCSS when running the server, you could run the server with one of these flags: ```sh hugo server --renderToDisk diff --git a/content/en/hugo-pipes/transpile-sass-to-css.md b/content/en/hugo-pipes/transpile-sass-to-css.md index 67ef4b7cd..886488ca6 100644 --- a/content/en/hugo-pipes/transpile-sass-to-css.md +++ b/content/en/hugo-pipes/transpile-sass-to-css.md @@ -42,7 +42,7 @@ transpiler targetPath : (`string`) If not set, the transformed resource's target path will be the original path of the asset file with its extension replaced by `.css`. -vars {{< new-in 0.109.0 >}} +vars : (`map`) A map of key-value pairs that will be available in the `hugo:vars` namespace. Useful for [initializing Sass variables from Hugo templates](https://discourse.gohugo.io/t/42053/). ```scss diff --git a/content/en/installation/_common/01-editions.md b/content/en/installation/_common/01-editions.md index 7a80a522e..b6fc23c74 100644 --- a/content/en/installation/_common/01-editions.md +++ b/content/en/installation/_common/01-editions.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- Hugo is available in three editions: standard, extended, and extended/deploy. While the standard edition provides core functionality, the extended and extended/deploy editions offer advanced features. diff --git a/content/en/installation/_common/02-prerequisites.md b/content/en/installation/_common/02-prerequisites.md index ea6eaa8fe..65ec2a12f 100644 --- a/content/en/installation/_common/02-prerequisites.md +++ b/content/en/installation/_common/02-prerequisites.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- ## Prerequisites diff --git a/content/en/installation/_common/03-prebuilt-binaries.md b/content/en/installation/_common/03-prebuilt-binaries.md index 55f7cb85b..34411cddd 100644 --- a/content/en/installation/_common/03-prebuilt-binaries.md +++ b/content/en/installation/_common/03-prebuilt-binaries.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- ## Prebuilt binaries diff --git a/content/en/installation/_common/04-build-from-source.md b/content/en/installation/_common/04-build-from-source.md index 6829c50ce..b3039d18a 100644 --- a/content/en/installation/_common/04-build-from-source.md +++ b/content/en/installation/_common/04-build-from-source.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- ## Build from source diff --git a/content/en/installation/_common/homebrew.md b/content/en/installation/_common/homebrew.md index 6cd7a524f..14f48174e 100644 --- a/content/en/installation/_common/homebrew.md +++ b/content/en/installation/_common/homebrew.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- ### Homebrew diff --git a/content/en/installation/linux.md b/content/en/installation/linux.md index 2403bf47b..14479d004 100644 --- a/content/en/installation/linux.md +++ b/content/en/installation/linux.md @@ -192,6 +192,16 @@ sudo eopkg install hugo [Solus]: https://getsol.us/ +### Void Linux + +To install the extended edition of Hugo on [Void Linux]: + +```sh +sudo xbps-install -S hugo +``` + +[Void Linux]: https://voidlinux.org/ + {{% include "installation/_common/04-build-from-source.md" %}} ## Comparison diff --git a/content/en/methods/menu-entry/PageRef.md b/content/en/methods/menu-entry/PageRef.md new file mode 100644 index 000000000..5d99d628c --- /dev/null +++ b/content/en/methods/menu-entry/PageRef.md @@ -0,0 +1,120 @@ +--- +title: PageRef +description: Returns the `pageRef` property of the given menu entry. +categories: [] +keywords: [] +action: + related: + - /methods/menu-entry/URL + returnType: string + signatures: [MENUENTRY.PageRef] +toc: true +--- + +The use case for this method is rare. + +In almost also scenarios you should use the [`URL`] method instead. + +## Explanation + +If you specify a `pageRef` property when [defining a menu entry] in your site configuration, Hugo looks for a matching page when rendering the entry. + +If a matching page is found: + +- The [`URL`] method returns the page's relative permalink +- The [`Page`] method returns the corresponding `Page` object +- The [`HasMenuCurrent`] and [`IsMenuCurrent`] methods on a `Page` object return the expected values + +If a matching page is not found: + +- The [`URL`] method returns the entry's `url` property if set, else an empty string +- The [`Page`] method returns nil +- The [`HasMenuCurrent`] and [`IsMenuCurrent`] methods on a `Page` object return `false` + +{{% note %}} +In almost also scenarios you should use the [`URL`] method instead. + +[`URL`]: /methods/menu-entry/url/ +{{% /note %}} + +[defining a menu entry]: /content-management/menus/#define-in-site-configuration +[`Page`]: /methods/menu-entry/page/ +[`URL`]: /methods/menu-entry/url/ +[`IsMenuCurrent`]: /methods/page/ismenucurrent/ +[`HasMenuCurrent`]: /methods/page/hasmenucurrent/ +[`RelPermalink`]: /methods/page/relpermalink/ + +## Example + +This example is contrived. + +{{% note %}} +In almost also scenarios you should use the [`URL`] method instead. + +[`URL`]: /methods/menu-entry/url/ +{{% /note %}} + + +Consider this content structure: + +```text +content/ +├── products.md +└── _index.md +``` + +And this menu definition: + +{{< code-toggle file=hugo >}} +[[menus.main]] +name = 'Products' +pageRef = '/products' +weight = 10 +[[menus.main]] +name = 'Services' +pageRef = '/services' +weight = 20 +{{< /code-toggle >}} + +With this template code: + +{{< code file=layouts/partials/menu.html >}} +
    + {{ range .Site.Menus.main }} +
  • {{ .Name }}
  • + {{ end }} +
+{{< /code >}} + +Hugo render this HTML: + +```html + +``` + +In the above note that the `href` attribute of the second `anchor` element is blank because Hugo was unable to find the "services" page. + +With this template code: + + +{{< code file=layouts/partials/menu.html >}} +
    + {{ range .Site.Menus.main }} +
  • {{ .Name }}
  • + {{ end }} +
+{{< /code >}} + +Hugo renders this HTML: + +```html + +``` + +In the above note that Hugo populates the `href` attribute of the second `anchor` element with the `pageRef` property as defined in the site configuration because the template code falls back to the `PageRef` method. diff --git a/content/en/methods/menu-entry/_common/pre-post.md b/content/en/methods/menu-entry/_common/pre-post.md index fbfce062a..da3d584d1 100644 --- a/content/en/methods/menu-entry/_common/pre-post.md +++ b/content/en/methods/menu-entry/_common/pre-post.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- In this site configuration we enable rendering of [emoji shortcodes], and add emoji shortcodes before (pre) and after (post) each menu entry: diff --git a/content/en/methods/page/Ancestors.md b/content/en/methods/page/Ancestors.md index 3bf36d9aa..da5cf2ca3 100644 --- a/content/en/methods/page/Ancestors.md +++ b/content/en/methods/page/Ancestors.md @@ -16,8 +16,6 @@ action: signatures: [PAGE.Ancestors] --- -{{< new-in 0.109.0 >}} - {{% include "methods/page/_common/definition-of-section.md" %}} With this content structure: diff --git a/content/en/methods/page/GitInfo.md b/content/en/methods/page/GitInfo.md index c54a77371..a05916d79 100644 --- a/content/en/methods/page/GitInfo.md +++ b/content/en/methods/page/GitInfo.md @@ -141,6 +141,7 @@ Some providers perform deep clones by default, others allow you to configure the Hosting service | Default clone depth | Configurable :-- | :-- | :-- +AWS Amplify | Deep | N/A Cloudflare Pages | Shallow | Yes [^CFP] DigitalOcean App Platform | Deep | N/A GitHub Pages | Shallow | Yes [^GHP] diff --git a/content/en/methods/page/HasMenuCurrent.md b/content/en/methods/page/HasMenuCurrent.md index a092f22c0..24ce462c9 100644 --- a/content/en/methods/page/HasMenuCurrent.md +++ b/content/en/methods/page/HasMenuCurrent.md @@ -28,4 +28,8 @@ If the `Page` object associated with the menu entry is a section, this method al See [menu templates] for a complete example. +{{% note %}} +When using this method you must either define the menu entry in front matter, or specify a `pageRef` property when defining the menu entry in your site configuration. +{{% /note %}} + [menu templates]: /templates/menu/#example diff --git a/content/en/methods/page/IsMenuCurrent.md b/content/en/methods/page/IsMenuCurrent.md index 8a939b1a1..a16be51ee 100644 --- a/content/en/methods/page/IsMenuCurrent.md +++ b/content/en/methods/page/IsMenuCurrent.md @@ -26,4 +26,8 @@ aliases: [/functions/ismenucurrent] See [menu templates] for a complete example. +{{% note %}} +When using this method you must either define the menu entry in front matter, or specify a `pageRef` property when defining the menu entry in your site configuration. +{{% /note %}} + [menu templates]: /templates/menu/#example diff --git a/content/en/methods/page/Store.md b/content/en/methods/page/Store.md index a81fa71a3..484c27fd5 100644 --- a/content/en/methods/page/Store.md +++ b/content/en/methods/page/Store.md @@ -1,11 +1,14 @@ --- title: Store +linktitle: PAGE.Store description: Returns a persistent "scratch pad" on the given page to store and manipulate data. categories: [] keywords: [] action: related: - methods/page/scratch + - methods/site/store + - functions/hugo/store - functions/collections/NewScratch returnType: maps.Scratch signatures: [PAGE.Store] diff --git a/content/en/methods/page/_common/definition-of-section.md b/content/en/methods/page/_common/definition-of-section.md index 7dc600789..79e22b10d 100644 --- a/content/en/methods/page/_common/definition-of-section.md +++ b/content/en/methods/page/_common/definition-of-section.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- A _section_ is a top-level content directory, or any content directory with an _index.md file. diff --git a/content/en/methods/page/_common/next-and-prev.md b/content/en/methods/page/_common/next-and-prev.md index 0d1436e11..c71392c8f 100644 --- a/content/en/methods/page/_common/next-and-prev.md +++ b/content/en/methods/page/_common/next-and-prev.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- Hugo determines the _next_ and _previous_ page by sorting the site's collection of regular pages according to this sorting hierarchy: diff --git a/content/en/methods/page/_common/nextinsection-and-previnsection.md b/content/en/methods/page/_common/nextinsection-and-previnsection.md index 6c558b69e..f2126eaee 100644 --- a/content/en/methods/page/_common/nextinsection-and-previnsection.md +++ b/content/en/methods/page/_common/nextinsection-and-previnsection.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- Hugo determines the _next_ and _previous_ page by sorting the current section's regular pages according to this sorting hierarchy: diff --git a/content/en/methods/page/_common/output-format-definition.md b/content/en/methods/page/_common/output-format-definition.md index d21211a3d..df89447f7 100644 --- a/content/en/methods/page/_common/output-format-definition.md +++ b/content/en/methods/page/_common/output-format-definition.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- Hugo generates one or more files per page when building a site. For example, when rendering home, [section], [taxonomy], and [term] pages, Hugo generates an HTML file and an RSS file. Both HTML and RSS are built-in _output formats_. Create multiple output formats, and control generation based on [page kind], or by enabling one or more output formats for one or more pages. See [details]. diff --git a/content/en/methods/page/_common/output-format-methods.md b/content/en/methods/page/_common/output-format-methods.md index 5e7111fe5..5390e7b46 100644 --- a/content/en/methods/page/_common/output-format-methods.md +++ b/content/en/methods/page/_common/output-format-methods.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- Get IDENTIFIER diff --git a/content/en/methods/page/_common/scratch-methods.md b/content/en/methods/page/_common/scratch-methods.md index b2650cdde..92a97cdd5 100644 --- a/content/en/methods/page/_common/scratch-methods.md +++ b/content/en/methods/page/_common/scratch-methods.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- ## Methods diff --git a/content/en/methods/pages/_common/group-sort-order.md b/content/en/methods/pages/_common/group-sort-order.md index bb5be82f6..e2997a1bd 100644 --- a/content/en/methods/pages/_common/group-sort-order.md +++ b/content/en/methods/pages/_common/group-sort-order.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- For the optional sort order, specify either `asc` for ascending order, or `desc` for descending order. diff --git a/content/en/methods/pages/_common/next-and-prev.md b/content/en/methods/pages/_common/next-and-prev.md index e0d05de84..540783992 100644 --- a/content/en/methods/pages/_common/next-and-prev.md +++ b/content/en/methods/pages/_common/next-and-prev.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- Hugo determines the _next_ and _previous_ page by sorting the page collection according to this sorting hierarchy: diff --git a/content/en/methods/resource/_common/global-page-remote-resources.md b/content/en/methods/resource/_common/global-page-remote-resources.md index 4ea4d1b87..5df2963e3 100644 --- a/content/en/methods/resource/_common/global-page-remote-resources.md +++ b/content/en/methods/resource/_common/global-page-remote-resources.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- {{% note %}} diff --git a/content/en/methods/resource/_common/processing-spec.md b/content/en/methods/resource/_common/processing-spec.md index b12a21d3a..395217328 100644 --- a/content/en/methods/resource/_common/processing-spec.md +++ b/content/en/methods/resource/_common/processing-spec.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- ## Process specification diff --git a/content/en/methods/shortcode/Ordinal.md b/content/en/methods/shortcode/Ordinal.md index 6f3580d0f..41393fa22 100644 --- a/content/en/methods/shortcode/Ordinal.md +++ b/content/en/methods/shortcode/Ordinal.md @@ -11,6 +11,10 @@ action: The `Ordinal` method returns the zero-based ordinal of the shortcode in relation to its parent. If the parent is the page itself, the ordinal represents the position of this shortcode in the page content. +{{% note %}} +Hugo increments the ordinal with each shortcode call, regardless of the specific shortcode type. This means that the ordinal value is tracked sequentially across all shortcodes within a given page. +{{% /note %}} + This method is useful for, among other things, assigning unique element IDs when a shortcode is called two or more times from the same page. For example: {{< code file=content/about.md lang=md >}} diff --git a/content/en/methods/shortcode/Scratch.md b/content/en/methods/shortcode/Scratch.md index fcfc99d53..811d9f9ee 100644 --- a/content/en/methods/shortcode/Scratch.md +++ b/content/en/methods/shortcode/Scratch.md @@ -10,7 +10,17 @@ action: signatures: [SHORTCODE.Scratch] --- -The `Scratch` method within a shortcode creates a [scratch pad] to store and manipulate data. The scratch pad is scoped to the shortcode, and is reset on server rebuilds. +{{% deprecated-in 0.139.0 %}} +Use the [`SHORTCODE.Store`] method instead. + +This is a soft deprecation. This method will be removed in a future release, but the removal date has not been established. Although Hugo will not emit a warning if you continue to use this method, you should begin using `SHORTCODE.Store` as soon as possible. + +Beginning with v0.139.0 the `SHORTCODE.Scratch` method is aliased to `SHORTCODE.Store`. + +[`SHORTCODE.Store`]: /methods/shortcode/store/ +{{% /deprecated-in %}} + +The `Scratch` method within a shortcode creates a [scratch pad] to store and manipulate data. The scratch pad is scoped to the shortcode. {{% note %}} With the introduction of the [`newScratch`] function, and the ability to [assign values to template variables] after initialization, the `Scratch` method within a shortcode is obsolete. diff --git a/content/en/methods/shortcode/Store.md b/content/en/methods/shortcode/Store.md new file mode 100644 index 000000000..f7be8c8d0 --- /dev/null +++ b/content/en/methods/shortcode/Store.md @@ -0,0 +1,29 @@ +--- +title: Store +description: Returns a "Store pad" scoped to the shortcode to store and manipulate data. +categories: [] +keywords: [] +action: + related: + - functions/collections/NewScratch + - methods/page/Store + - methods/site/Store + - functions/hugo/Store + returnType: maps.Store + signatures: [SHORTCODE.Store] +--- + +{{< new-in 0.139.0 >}} + +The `Store` method within a shortcode creates a [scratch pad] to store and manipulate data. The scratch pad is scoped to the shortcode. + +{{% note %}} +With the introduction of the [`newScratch`] function, and the ability to [assign values to template variables] after initialization, the `Store` method within a shortcode is mostly obsolete. + +[assign values to template variables]: https://go.dev/doc/go1.11#text/template +[`newScratch`]: /functions/collections/newScratch/ +{{% /note %}} + +[Store pad]: /getting-started/glossary/#scratch-pad + +{{% include "methods/page/_common/scratch-methods.md" %}} diff --git a/content/en/methods/site/Store.md b/content/en/methods/site/Store.md new file mode 100644 index 000000000..1c54007ab --- /dev/null +++ b/content/en/methods/site/Store.md @@ -0,0 +1,126 @@ +--- +title: Store +linktitle: site.Store +description: Returns a persistent "scratch pad" on the given site to store and manipulate data. +categories: [] +keywords: [] +action: + related: + - methods/page/store + - functions/hugo/store + - functions/collections/NewScratch + returnType: maps.Scratch + signatures: [site.Store] +toc: true +--- + +{{< new-in 0.139.0 >}} + +The `Store` method on a `Site` object creates a persistent [scratch pad] to store and manipulate data. To create a locally scoped scratch pad that is not attached to a `Site` object, use the [`newScratch`] function. + +[`Scratch`]: /methods/site/scratch/ +[`newScratch`]: /functions/collections/newscratch/ +[scratch pad]: /getting-started/glossary/#scratch-pad + +## Methods + +###### Set + +Sets the value of a given key. + +```go-html-template +{{ site.Store.Set "greeting" "Hello" }} +``` + +###### Get + +Gets the value of a given key. + +```go-html-template +{{ site.Store.Set "greeting" "Hello" }} +{{ site.Store.Get "greeting" }} → Hello +``` + +###### Add + +Adds a given value to existing value(s) of the given key. + +For single values, `Add` accepts values that support Go's `+` operator. If the first `Add` for a key is an array or slice, the following adds will be appended to that list. + +```go-html-template +{{ site.Store.Set "greeting" "Hello" }} +{{ site.Store.Add "greeting" "Welcome" }} +{{ site.Store.Get "greeting" }} → HelloWelcome +``` + +```go-html-template +{{ site.Store.Set "total" 3 }} +{{ site.Store.Add "total" 7 }} +{{ site.Store.Get "total" }} → 10 +``` + +```go-html-template +{{ site.Store.Set "greetings" (slice "Hello") }} +{{ site.Store.Add "greetings" (slice "Welcome" "Cheers") }} +{{ site.Store.Get "greetings" }} → [Hello Welcome Cheers] +``` + +###### SetInMap + +Takes a `key`, `mapKey` and `value` and adds a map of `mapKey` and `value` to the given `key`. + +```go-html-template +{{ site.Store.SetInMap "greetings" "english" "Hello" }} +{{ site.Store.SetInMap "greetings" "french" "Bonjour" }} +{{ site.Store.Get "greetings" }} → map[english:Hello french:Bonjour] +``` + +###### DeleteInMap + +Takes a `key` and `mapKey` and removes the map of `mapKey` from the given `key`. + +```go-html-template +{{ site.Store.SetInMap "greetings" "english" "Hello" }} +{{ site.Store.SetInMap "greetings" "french" "Bonjour" }} +{{ site.Store.DeleteInMap "greetings" "english" }} +{{ site.Store.Get "greetings" }} → map[french:Bonjour] +``` + +###### GetSortedMapValues + +Returns an array of values from `key` sorted by `mapKey`. + +```go-html-template +{{ site.Store.SetInMap "greetings" "english" "Hello" }} +{{ site.Store.SetInMap "greetings" "french" "Bonjour" }} +{{ site.Store.GetSortedMapValues "greetings" }} → [Hello Bonjour] +``` + +###### Delete + +Removes the given key. + +```go-html-template +{{ site.Store.Set "greeting" "Hello" }} +{{ site.Store.Delete "greeting" }} +``` + +## Determinate values + +The `Store` method is often used to set scratch pad values within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the scratch pad values are indeterminate until Hugo renders the page content. + +If you need to access a scratch pad value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a [noop] variable: + +[noop]: /getting-started/glossary/#noop + +```go-html-template +{{ $noop := .Content }} +{{ site.Store.Get "mykey" }} +``` + +You can also trigger content rendering with the `ContentWithoutSummary`, `FuzzyWordCount`, `Len`, `Plain`, `PlainWords`, `ReadingTime`, `Summary`, `Truncated`, and `WordCount` methods. For example: + +```go-html-template +{{ $noop := .WordCount }} +{{ site.Store.Get "mykey" }} +``` diff --git a/content/en/methods/taxonomy/_common/get-a-taxonomy-object.md b/content/en/methods/taxonomy/_common/get-a-taxonomy-object.md index ef78c8eae..928ec085a 100644 --- a/content/en/methods/taxonomy/_common/get-a-taxonomy-object.md +++ b/content/en/methods/taxonomy/_common/get-a-taxonomy-object.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- Before we can use a `Taxonomy` method, we need to capture a `Taxonomy` object. diff --git a/content/en/methods/taxonomy/_common/ordered-taxonomy-element-methods.md b/content/en/methods/taxonomy/_common/ordered-taxonomy-element-methods.md index 7201ad318..a23c26ef5 100644 --- a/content/en/methods/taxonomy/_common/ordered-taxonomy-element-methods.md +++ b/content/en/methods/taxonomy/_common/ordered-taxonomy-element-methods.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- An ordered taxonomy is a slice, where each element is an object that contains the term and a slice of its weighted pages. diff --git a/content/en/render-hooks/_common/pageinner.md b/content/en/render-hooks/_common/pageinner.md index de1316cba..1d467aeef 100644 --- a/content/en/render-hooks/_common/pageinner.md +++ b/content/en/render-hooks/_common/pageinner.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- ## PageInner details diff --git a/content/en/render-hooks/code-blocks.md b/content/en/render-hooks/code-blocks.md index d322cb88d..f43df06c7 100755 --- a/content/en/render-hooks/code-blocks.md +++ b/content/en/render-hooks/code-blocks.md @@ -122,7 +122,7 @@ For example, to create a code block render hook to render [Mermaid] diagrams: {{< code file=layouts/_default/_markup/render-codeblock-mermaid.html copy=true >}}
-  {{- .Inner | safeHTML }}
+  {{- .Inner | htmlEscape | safeHTML }}
 
{{ .Page.Store.Set "hasMermaid" true }} {{< /code >}} diff --git a/content/en/templates/_common/filter-sort-group.md b/content/en/templates/_common/filter-sort-group.md index 89cc095f5..24bbee96e 100644 --- a/content/en/templates/_common/filter-sort-group.md +++ b/content/en/templates/_common/filter-sort-group.md @@ -1,5 +1,5 @@ --- -# Do not remove front matter. +_comment: Do not remove front matter. --- {{% note %}} diff --git a/content/en/templates/introduction.md b/content/en/templates/introduction.md index e5650149a..f8f50dfaa 100644 --- a/content/en/templates/introduction.md +++ b/content/en/templates/introduction.md @@ -167,7 +167,7 @@ Whitespace includes spaces, horizontal tabs, carriage returns, and newlines. ### Pipes -Within a template action you may [pipe] a value to function or method. The piped value becomes the final argument to the function or method. For example, these are equivalent: +Within a template action you may [pipe] a value to a function or method. The piped value becomes the final argument to the function or method. For example, these are equivalent: [pipe]: /getting-started/glossary/#pipeline diff --git a/data/docs.yaml b/data/docs.yaml index 8d97c21e0..4999bfc0b 100644 --- a/data/docs.yaml +++ b/data/docs.yaml @@ -2440,17 +2440,6 @@ tpl: treating values as key-value pairs. The number of values must be even. The keys can be string slices, which will create the needed nested structure. Examples: [] - EchoParam: - Aliases: - - echoParam - Args: - - c - - k - Description: |- - EchoParam returns the value in the collection c with key k if is set; otherwise, it returns an - empty string. - Deprecated: Use the index function instead. - Examples: [] First: Aliases: - first @@ -3119,6 +3108,11 @@ tpl: Args: null Description: "" Examples: null + Store: + Aliases: null + Args: null + Description: "" + Examples: null Version: Aliases: null Args: null @@ -3384,11 +3378,6 @@ tpl: Args: null Description: "" Examples: null - NumFmt: - Aliases: null - Args: null - Description: "" - Examples: null Translate: Aliases: - i18n @@ -4002,11 +3991,6 @@ tpl: Args: null Description: "" Examples: null - DisqusShortname: - Aliases: null - Args: null - Description: "" - Examples: null ForEeachIdentityByName: Aliases: null Args: null @@ -4017,11 +4001,6 @@ tpl: Args: null Description: "" Examples: null - GoogleAnalytics: - Aliases: null - Args: null - Description: "" - Examples: null Home: Aliases: null Args: null @@ -4037,11 +4016,6 @@ tpl: Args: null Description: "" Examples: null - IsServer: - Aliases: null - Args: null - Description: "" - Examples: null Key: Aliases: null Args: null @@ -4102,11 +4076,6 @@ tpl: Args: null Description: "" Examples: null - RSSLink: - Aliases: null - Args: null - Description: "" - Examples: null RegularPages: Aliases: null Args: null @@ -4132,6 +4101,11 @@ tpl: Args: null Description: "" Examples: null + Store: + Aliases: null + Args: null + Description: "" + Examples: null Taxonomies: Aliases: null Args: null @@ -4457,6 +4431,11 @@ tpl: Examples: - - '{{ "aabbaa" | strings.TrimRight "a" }}' - aabb + TrimSpace: + Aliases: null + Args: null + Description: "" + Examples: null TrimSuffix: Aliases: null Args: diff --git a/go.mod b/go.mod index a9d63af19..5e909630f 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/gohugoio/hugoDocs -go 1.16 +go 1.22.0 -require github.com/gohugoio/gohugoioTheme v0.0.0-20241105120803-6c6e5fb8f8af // indirect +require github.com/gohugoio/gohugoioTheme v0.0.0-20241119115653-b92d27ede3e1 // indirect diff --git a/go.sum b/go.sum index 5c0e10736..e1863b60e 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,2 @@ -github.com/gohugoio/gohugoioTheme v0.0.0-20241105040910-e9dac9458255 h1:kaSc7cVAifWPRzmECr7il0YXgXBM+H2ZrGcNnb03S8k= -github.com/gohugoio/gohugoioTheme v0.0.0-20241105040910-e9dac9458255/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM= -github.com/gohugoio/gohugoioTheme v0.0.0-20241105120803-6c6e5fb8f8af h1:H8Oa4AEJs2yz8w1Gq9hEGBJNukkKo05OAaIEsHMd63k= -github.com/gohugoio/gohugoioTheme v0.0.0-20241105120803-6c6e5fb8f8af/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM= +github.com/gohugoio/gohugoioTheme v0.0.0-20241119115653-b92d27ede3e1 h1:d6XNQ4QYvJGIE8vMejUFTD89AWaPDywcLivzWpEU0qE= +github.com/gohugoio/gohugoioTheme v0.0.0-20241119115653-b92d27ede3e1/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM= diff --git a/netlify.toml b/netlify.toml index 5079ac44d..995057a75 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,7 +3,7 @@ command = "hugo --gc --minify" [build.environment] - HUGO_VERSION = "0.138.0" + HUGO_VERSION = "0.139.4" [context.production.environment] HUGO_ENV = "production"