From 32ba623541d74ee0b7ae4efb1b8326dc49af28b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 8 Jun 2021 18:46:58 +0200 Subject: [PATCH] Squashed 'docs/' changes from bcc4f9324..4c81c6c2a 4c81c6c2a live reload: add section about `--navigateToChanged` 271014257 Update netify hugo version to 0.83.1 14199cff1 Add pull_request event 0c33b05de Hosting on GitHub: Little wording fixes and update Ubuntu runner in example workflow to 20.04 (#1457) e47b6c33a Hugo Modules plural typo (#1266) 0f2bbacdd Add node_modules to .gitignore 1d645d79f Overhaul scratch.md (#1451) 572766889 Add link to golang regex syntax, change modified date 21b0c7459 Add info about contentType config de7d96fa2 Document Go template's multiline support 0c8f2dcb1 Avoid scratch usage 696fa92e1 Rename scratch var 44193f267 Update usage instructions 4230f8fa5 Rename and refactor shortcode e9953751e Strip leading whitespaces d61a58010 Add `insertpages` shortcode 04d30677d Mention WebP under 'Target Format' (#1431) 946784508 Update lookup-order.md (#1443) a7b587988 Update index.md 27907f7ea netlify: Hugo 0.83.1 044d37e57 Merge branch 'tempv0.83.1' b81aedb03 Fix page `.Kind` fcf7775ad releaser: Add release notes to /docs for release of 0.83.1 9b39c77c8 fix typo in 0.83 release notes 1c38993ce Update index.md 45b8aefa6 Update index.md 43902dfaa Update index.md 3d959c7ae Merge branch 'tempv0.83.0' 6c22dc327 Fix URL 497ea3224 Use Hugo version badge shortcode a182d10dd releaser: Add release notes to /docs for release of 0.83.0 287fd9ac0 docs: Fix shortcode e789c879a docs: Regenerate docs helper 1666c7f31 docs: Regenerate CLI docs 117de1d12 Merge commit 'c239c643fee10bfa217cb108755b798f8f5f3b10' a6bf3f7d9 docs: Regen docs helper git-subtree-dir: docs git-subtree-split: 4c81c6c2ace6c23d0d5d24ee37e6a2f30acba01e --- .gitignore | 1 + content/en/commands/hugo.md | 2 - content/en/commands/hugo_check.md | 2 - content/en/commands/hugo_check_ulimit.md | 2 - content/en/commands/hugo_config.md | 2 - content/en/commands/hugo_config_mounts.md | 2 - content/en/commands/hugo_convert.md | 2 - content/en/commands/hugo_convert_toJSON.md | 2 - content/en/commands/hugo_convert_toTOML.md | 2 - content/en/commands/hugo_convert_toYAML.md | 2 - content/en/commands/hugo_deploy.md | 2 - content/en/commands/hugo_env.md | 5 +- content/en/commands/hugo_gen.md | 2 - content/en/commands/hugo_gen_autocomplete.md | 2 - content/en/commands/hugo_gen_chromastyles.md | 2 - content/en/commands/hugo_gen_doc.md | 2 - content/en/commands/hugo_gen_man.md | 2 - content/en/commands/hugo_import.md | 2 - content/en/commands/hugo_import_jekyll.md | 2 - content/en/commands/hugo_list.md | 2 - content/en/commands/hugo_list_all.md | 2 - content/en/commands/hugo_list_drafts.md | 2 - content/en/commands/hugo_list_expired.md | 2 - content/en/commands/hugo_list_future.md | 2 - content/en/commands/hugo_mod.md | 2 - content/en/commands/hugo_mod_clean.md | 2 - content/en/commands/hugo_mod_get.md | 2 - content/en/commands/hugo_mod_graph.md | 2 - content/en/commands/hugo_mod_init.md | 2 - content/en/commands/hugo_mod_npm.md | 2 - content/en/commands/hugo_mod_npm_pack.md | 2 - content/en/commands/hugo_mod_tidy.md | 2 - content/en/commands/hugo_mod_vendor.md | 2 - content/en/commands/hugo_mod_verify.md | 2 - content/en/commands/hugo_new.md | 2 - content/en/commands/hugo_new_site.md | 2 - content/en/commands/hugo_new_theme.md | 2 - content/en/commands/hugo_server.md | 2 - content/en/commands/hugo_version.md | 2 - .../image-processing/index.md | 20 +- content/en/functions/scratch.md | 112 +-- content/en/getting-started/usage.md | 5 + .../hosting-on-github.md | 12 +- .../hosting-on-netlify.md | 4 +- .../en/hosting-and-deployment/hugo-deploy.md | 13 +- content/en/hugo-modules/_index.md | 2 +- content/en/news/0.83.0-relnotes/featured.png | Bin 0 -> 82972 bytes content/en/news/0.83.0-relnotes/index.md | 133 +++ content/en/news/0.83.1-relnotes/index.md | 19 + content/en/readfiles/pages-vs-site-pages.md | 4 +- content/en/templates/introduction.md | 16 + content/en/templates/lookup-order.md | 2 +- content/en/variables/page.md | 4 +- content/en/variables/site.md | 4 +- data/docs.json | 55 +- hugo_stats.json | 820 ++++++++++++++++++ layouts/shortcodes/getcontent.html | 21 + netlify.toml | 8 +- ...c231b7_82972_480x0_resize_catmullrom_2.png | Bin 0 -> 30263 bytes ...c231b7_82972_640x0_resize_catmullrom_2.png | Bin 0 -> 50607 bytes 60 files changed, 1177 insertions(+), 157 deletions(-) create mode 100644 content/en/news/0.83.0-relnotes/featured.png create mode 100644 content/en/news/0.83.0-relnotes/index.md create mode 100644 content/en/news/0.83.1-relnotes/index.md create mode 100644 hugo_stats.json create mode 100644 layouts/shortcodes/getcontent.html create mode 100644 resources/_gen/images/news/0.83.0-relnotes/featured_hu95eea831049f54a9a3609e4be0c231b7_82972_480x0_resize_catmullrom_2.png create mode 100644 resources/_gen/images/news/0.83.0-relnotes/featured_hu95eea831049f54a9a3609e4be0c231b7_82972_640x0_resize_catmullrom_2.png diff --git a/.gitignore b/.gitignore index b203a37cd..6f4431f42 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /.idea /public +node_modules nohup.out .DS_Store trace.out \ No newline at end of file diff --git a/content/en/commands/hugo.md b/content/en/commands/hugo.md index b503fe40a..7b90bae2e 100644 --- a/content/en/commands/hugo.md +++ b/content/en/commands/hugo.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo" slug: hugo url: /commands/hugo/ @@ -81,4 +80,3 @@ hugo [flags] * [hugo server](/commands/hugo_server/) - A high performance webserver * [hugo version](/commands/hugo_version/) - Print the version number of Hugo -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_check.md b/content/en/commands/hugo_check.md index afec5dbb3..1c9bb0c9d 100644 --- a/content/en/commands/hugo_check.md +++ b/content/en/commands/hugo_check.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo check" slug: hugo_check url: /commands/hugo_check/ @@ -37,4 +36,3 @@ Contains some verification checks * [hugo](/commands/hugo/) - hugo builds your site * [hugo check ulimit](/commands/hugo_check_ulimit/) - Check system ulimit settings -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_check_ulimit.md b/content/en/commands/hugo_check_ulimit.md index 676560913..a27bd6837 100644 --- a/content/en/commands/hugo_check_ulimit.md +++ b/content/en/commands/hugo_check_ulimit.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo check ulimit" slug: hugo_check_ulimit url: /commands/hugo_check_ulimit/ @@ -45,4 +44,3 @@ hugo check ulimit [flags] * [hugo check](/commands/hugo_check/) - Contains some verification checks -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_config.md b/content/en/commands/hugo_config.md index ad1c699dc..e305e68d0 100644 --- a/content/en/commands/hugo_config.md +++ b/content/en/commands/hugo_config.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo config" slug: hugo_config url: /commands/hugo_config/ @@ -45,4 +44,3 @@ hugo config [flags] * [hugo](/commands/hugo/) - hugo builds your site * [hugo config mounts](/commands/hugo_config_mounts/) - Print the configured file mounts -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_config_mounts.md b/content/en/commands/hugo_config_mounts.md index 34755e8df..f12ec8dfa 100644 --- a/content/en/commands/hugo_config_mounts.md +++ b/content/en/commands/hugo_config_mounts.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo config mounts" slug: hugo_config_mounts url: /commands/hugo_config_mounts/ @@ -40,4 +39,3 @@ hugo config mounts [flags] * [hugo config](/commands/hugo_config/) - Print the site configuration -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_convert.md b/content/en/commands/hugo_convert.md index f88bb3e49..df67d3c1d 100644 --- a/content/en/commands/hugo_convert.md +++ b/content/en/commands/hugo_convert.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo convert" slug: hugo_convert url: /commands/hugo_convert/ @@ -47,4 +46,3 @@ See convert's subcommands toJSON, toTOML and toYAML for more information. * [hugo convert toTOML](/commands/hugo_convert_totoml/) - Convert front matter to TOML * [hugo convert toYAML](/commands/hugo_convert_toyaml/) - Convert front matter to YAML -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_convert_toJSON.md b/content/en/commands/hugo_convert_toJSON.md index b8e255087..a6840bbfd 100644 --- a/content/en/commands/hugo_convert_toJSON.md +++ b/content/en/commands/hugo_convert_toJSON.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo convert toJSON" slug: hugo_convert_toJSON url: /commands/hugo_convert_tojson/ @@ -47,4 +46,3 @@ hugo convert toJSON [flags] * [hugo convert](/commands/hugo_convert/) - Convert your content to different formats -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_convert_toTOML.md b/content/en/commands/hugo_convert_toTOML.md index aaf935dc3..522af07b3 100644 --- a/content/en/commands/hugo_convert_toTOML.md +++ b/content/en/commands/hugo_convert_toTOML.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo convert toTOML" slug: hugo_convert_toTOML url: /commands/hugo_convert_totoml/ @@ -47,4 +46,3 @@ hugo convert toTOML [flags] * [hugo convert](/commands/hugo_convert/) - Convert your content to different formats -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_convert_toYAML.md b/content/en/commands/hugo_convert_toYAML.md index d9d3c92f7..656556d30 100644 --- a/content/en/commands/hugo_convert_toYAML.md +++ b/content/en/commands/hugo_convert_toYAML.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo convert toYAML" slug: hugo_convert_toYAML url: /commands/hugo_convert_toyaml/ @@ -47,4 +46,3 @@ hugo convert toYAML [flags] * [hugo convert](/commands/hugo_convert/) - Convert your content to different formats -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_deploy.md b/content/en/commands/hugo_deploy.md index d20dddeee..41ae5d457 100644 --- a/content/en/commands/hugo_deploy.md +++ b/content/en/commands/hugo_deploy.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo deploy" slug: hugo_deploy url: /commands/hugo_deploy/ @@ -54,4 +53,3 @@ hugo deploy [flags] * [hugo](/commands/hugo/) - hugo builds your site -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_env.md b/content/en/commands/hugo_env.md index a62315ab1..c5919b248 100644 --- a/content/en/commands/hugo_env.md +++ b/content/en/commands/hugo_env.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo env" slug: hugo_env url: /commands/hugo_env/ @@ -12,6 +11,9 @@ Print Hugo version and environment info Print Hugo version and environment info. This is useful in Hugo bug reports. +If you add the -v flag, you will get a full dependency list. + + ``` hugo env [flags] ``` @@ -44,4 +46,3 @@ hugo env [flags] * [hugo](/commands/hugo/) - hugo builds your site -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_gen.md b/content/en/commands/hugo_gen.md index 05c3bcb52..84ec7ecba 100644 --- a/content/en/commands/hugo_gen.md +++ b/content/en/commands/hugo_gen.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo gen" slug: hugo_gen url: /commands/hugo_gen/ @@ -40,4 +39,3 @@ A collection of several useful generators. * [hugo gen doc](/commands/hugo_gen_doc/) - Generate Markdown documentation for the Hugo CLI. * [hugo gen man](/commands/hugo_gen_man/) - Generate man pages for the Hugo CLI -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_gen_autocomplete.md b/content/en/commands/hugo_gen_autocomplete.md index 3b9561366..7d2d4fd68 100644 --- a/content/en/commands/hugo_gen_autocomplete.md +++ b/content/en/commands/hugo_gen_autocomplete.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo gen autocomplete" slug: hugo_gen_autocomplete url: /commands/hugo_gen_autocomplete/ @@ -58,4 +57,3 @@ hugo gen autocomplete [flags] * [hugo gen](/commands/hugo_gen/) - A collection of several useful generators. -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_gen_chromastyles.md b/content/en/commands/hugo_gen_chromastyles.md index cd9dffad3..e7b58bf03 100644 --- a/content/en/commands/hugo_gen_chromastyles.md +++ b/content/en/commands/hugo_gen_chromastyles.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo gen chromastyles" slug: hugo_gen_chromastyles url: /commands/hugo_gen_chromastyles/ @@ -49,4 +48,3 @@ hugo gen chromastyles [flags] * [hugo gen](/commands/hugo_gen/) - A collection of several useful generators. -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_gen_doc.md b/content/en/commands/hugo_gen_doc.md index 9b7279e26..8c17b594d 100644 --- a/content/en/commands/hugo_gen_doc.md +++ b/content/en/commands/hugo_gen_doc.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo gen doc" slug: hugo_gen_doc url: /commands/hugo_gen_doc/ @@ -51,4 +50,3 @@ hugo gen doc [flags] * [hugo gen](/commands/hugo_gen/) - A collection of several useful generators. -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_gen_man.md b/content/en/commands/hugo_gen_man.md index 7bb21c3ae..9aef9ab8e 100644 --- a/content/en/commands/hugo_gen_man.md +++ b/content/en/commands/hugo_gen_man.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo gen man" slug: hugo_gen_man url: /commands/hugo_gen_man/ @@ -47,4 +46,3 @@ hugo gen man [flags] * [hugo gen](/commands/hugo_gen/) - A collection of several useful generators. -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_import.md b/content/en/commands/hugo_import.md index 01520a4c2..1170b3b16 100644 --- a/content/en/commands/hugo_import.md +++ b/content/en/commands/hugo_import.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo import" slug: hugo_import url: /commands/hugo_import/ @@ -43,4 +42,3 @@ Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_p * [hugo](/commands/hugo/) - hugo builds your site * [hugo import jekyll](/commands/hugo_import_jekyll/) - hugo import from Jekyll -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_import_jekyll.md b/content/en/commands/hugo_import_jekyll.md index d9a9487b9..f1d811fe6 100644 --- a/content/en/commands/hugo_import_jekyll.md +++ b/content/en/commands/hugo_import_jekyll.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo import jekyll" slug: hugo_import_jekyll url: /commands/hugo_import_jekyll/ @@ -47,4 +46,3 @@ hugo import jekyll [flags] * [hugo import](/commands/hugo_import/) - Import your site from others. -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_list.md b/content/en/commands/hugo_list.md index 60f57a109..7f70ccb0e 100644 --- a/content/en/commands/hugo_list.md +++ b/content/en/commands/hugo_list.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo list" slug: hugo_list url: /commands/hugo_list/ @@ -46,4 +45,3 @@ List requires a subcommand, e.g. `hugo list drafts`. * [hugo list expired](/commands/hugo_list_expired/) - List all posts already expired * [hugo list future](/commands/hugo_list_future/) - List all posts dated in the future -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_list_all.md b/content/en/commands/hugo_list_all.md index a6325b125..1a52f3f3e 100644 --- a/content/en/commands/hugo_list_all.md +++ b/content/en/commands/hugo_list_all.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo list all" slug: hugo_list_all url: /commands/hugo_list_all/ @@ -44,4 +43,3 @@ hugo list all [flags] * [hugo list](/commands/hugo_list/) - Listing out various types of content -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_list_drafts.md b/content/en/commands/hugo_list_drafts.md index c29d52cb3..0de7b0964 100644 --- a/content/en/commands/hugo_list_drafts.md +++ b/content/en/commands/hugo_list_drafts.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo list drafts" slug: hugo_list_drafts url: /commands/hugo_list_drafts/ @@ -44,4 +43,3 @@ hugo list drafts [flags] * [hugo list](/commands/hugo_list/) - Listing out various types of content -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_list_expired.md b/content/en/commands/hugo_list_expired.md index 320eaf0d1..71e938da1 100644 --- a/content/en/commands/hugo_list_expired.md +++ b/content/en/commands/hugo_list_expired.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo list expired" slug: hugo_list_expired url: /commands/hugo_list_expired/ @@ -44,4 +43,3 @@ hugo list expired [flags] * [hugo list](/commands/hugo_list/) - Listing out various types of content -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_list_future.md b/content/en/commands/hugo_list_future.md index acc594dc7..b723ee005 100644 --- a/content/en/commands/hugo_list_future.md +++ b/content/en/commands/hugo_list_future.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo list future" slug: hugo_list_future url: /commands/hugo_list_future/ @@ -44,4 +43,3 @@ hugo list future [flags] * [hugo list](/commands/hugo_list/) - Listing out various types of content -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_mod.md b/content/en/commands/hugo_mod.md index b726f8d8f..e2be82ac3 100644 --- a/content/en/commands/hugo_mod.md +++ b/content/en/commands/hugo_mod.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo mod" slug: hugo_mod url: /commands/hugo_mod/ @@ -84,4 +83,3 @@ See https://gohugo.io/hugo-modules/ for more information. * [hugo mod vendor](/commands/hugo_mod_vendor/) - Vendor all module dependencies into the _vendor directory. * [hugo mod verify](/commands/hugo_mod_verify/) - Verify dependencies. -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_mod_clean.md b/content/en/commands/hugo_mod_clean.md index 0095db3fa..81caa6c91 100644 --- a/content/en/commands/hugo_mod_clean.md +++ b/content/en/commands/hugo_mod_clean.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo mod clean" slug: hugo_mod_clean url: /commands/hugo_mod_clean/ @@ -52,4 +51,3 @@ hugo mod clean [flags] * [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers. -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_mod_get.md b/content/en/commands/hugo_mod_get.md index 3549459fe..f2f9cff0c 100644 --- a/content/en/commands/hugo_mod_get.md +++ b/content/en/commands/hugo_mod_get.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo mod get" slug: hugo_mod_get url: /commands/hugo_mod_get/ @@ -70,4 +69,3 @@ hugo mod get [flags] * [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers. -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_mod_graph.md b/content/en/commands/hugo_mod_graph.md index 72405b036..af8b01faf 100644 --- a/content/en/commands/hugo_mod_graph.md +++ b/content/en/commands/hugo_mod_graph.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo mod graph" slug: hugo_mod_graph url: /commands/hugo_mod_graph/ @@ -46,4 +45,3 @@ hugo mod graph [flags] * [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers. -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_mod_init.md b/content/en/commands/hugo_mod_init.md index 680a085cc..a7a569d30 100644 --- a/content/en/commands/hugo_mod_init.md +++ b/content/en/commands/hugo_mod_init.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo mod init" slug: hugo_mod_init url: /commands/hugo_mod_init/ @@ -51,4 +50,3 @@ hugo mod init [flags] * [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers. -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_mod_npm.md b/content/en/commands/hugo_mod_npm.md index 02932fe04..5d0008705 100644 --- a/content/en/commands/hugo_mod_npm.md +++ b/content/en/commands/hugo_mod_npm.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo mod npm" slug: hugo_mod_npm url: /commands/hugo_mod_npm/ @@ -45,4 +44,3 @@ hugo mod npm [flags] * [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers. * [hugo mod npm pack](/commands/hugo_mod_npm_pack/) - Experimental: Prepares and writes a composite package.json file for your project. -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_mod_npm_pack.md b/content/en/commands/hugo_mod_npm_pack.md index cefd7d2c8..809c3a5bf 100644 --- a/content/en/commands/hugo_mod_npm_pack.md +++ b/content/en/commands/hugo_mod_npm_pack.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo mod npm pack" slug: hugo_mod_npm_pack url: /commands/hugo_mod_npm_pack/ @@ -54,4 +53,3 @@ hugo mod npm pack [flags] * [hugo mod npm](/commands/hugo_mod_npm/) - Various npm helpers. -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_mod_tidy.md b/content/en/commands/hugo_mod_tidy.md index 436cdaf41..925def7cb 100644 --- a/content/en/commands/hugo_mod_tidy.md +++ b/content/en/commands/hugo_mod_tidy.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo mod tidy" slug: hugo_mod_tidy url: /commands/hugo_mod_tidy/ @@ -40,4 +39,3 @@ hugo mod tidy [flags] * [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers. -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_mod_vendor.md b/content/en/commands/hugo_mod_vendor.md index 5d1fd96cc..2d18951f3 100644 --- a/content/en/commands/hugo_mod_vendor.md +++ b/content/en/commands/hugo_mod_vendor.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo mod vendor" slug: hugo_mod_vendor url: /commands/hugo_mod_vendor/ @@ -47,4 +46,3 @@ hugo mod vendor [flags] * [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers. -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_mod_verify.md b/content/en/commands/hugo_mod_verify.md index 753030ced..cd9b1cbf1 100644 --- a/content/en/commands/hugo_mod_verify.md +++ b/content/en/commands/hugo_mod_verify.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo mod verify" slug: hugo_mod_verify url: /commands/hugo_mod_verify/ @@ -46,4 +45,3 @@ hugo mod verify [flags] * [hugo mod](/commands/hugo_mod/) - Various Hugo Modules helpers. -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_new.md b/content/en/commands/hugo_new.md index 35816e5b6..17e305c00 100644 --- a/content/en/commands/hugo_new.md +++ b/content/en/commands/hugo_new.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo new" slug: hugo_new url: /commands/hugo_new/ @@ -79,4 +78,3 @@ hugo new [path] [flags] * [hugo new site](/commands/hugo_new_site/) - Create a new site (skeleton) * [hugo new theme](/commands/hugo_new_theme/) - Create a new theme -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_new_site.md b/content/en/commands/hugo_new_site.md index f7b330e7c..60e58b1bc 100644 --- a/content/en/commands/hugo_new_site.md +++ b/content/en/commands/hugo_new_site.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo new site" slug: hugo_new_site url: /commands/hugo_new_site/ @@ -48,4 +47,3 @@ hugo new site [path] [flags] * [hugo new](/commands/hugo_new/) - Create new content for your site -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_new_theme.md b/content/en/commands/hugo_new_theme.md index d040a252f..3563f5b73 100644 --- a/content/en/commands/hugo_new_theme.md +++ b/content/en/commands/hugo_new_theme.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo new theme" slug: hugo_new_theme url: /commands/hugo_new_theme/ @@ -47,4 +46,3 @@ hugo new theme [name] [flags] * [hugo new](/commands/hugo_new/) - Create new content for your site -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_server.md b/content/en/commands/hugo_server.md index fc984c742..47664f0b6 100644 --- a/content/en/commands/hugo_server.md +++ b/content/en/commands/hugo_server.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo server" slug: hugo_server url: /commands/hugo_server/ @@ -92,4 +91,3 @@ hugo server [flags] * [hugo](/commands/hugo/) - hugo builds your site -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/commands/hugo_version.md b/content/en/commands/hugo_version.md index f73acc82a..f17671aed 100644 --- a/content/en/commands/hugo_version.md +++ b/content/en/commands/hugo_version.md @@ -1,5 +1,4 @@ --- -date: 2021-03-21 title: "hugo version" slug: hugo_version url: /commands/hugo_version/ @@ -44,4 +43,3 @@ hugo version [flags] * [hugo](/commands/hugo/) - hugo builds your site -###### Auto generated by spf13/cobra on 21-Mar-2021 diff --git a/content/en/content-management/image-processing/index.md b/content/en/content-management/image-processing/index.md index 8cd00210f..5b3dce57f 100644 --- a/content/en/content-management/image-processing/index.md +++ b/content/en/content-management/image-processing/index.md @@ -167,19 +167,21 @@ For color codes, see https://www.google.com/search?q=color+picker **Note** that you also set a default background color to use, see [Image Processing Config](#image-processing-config). -### JPEG and Webp Quality +### JPEG and WebP Quality -Only relevant for JPEG and Webp images, values 1 to 100 inclusive, higher is better. Default is 75. +Only relevant for JPEG and WebP images, values 1 to 100 inclusive, higher is better. Default is 75. ```go {{ $image.Resize "600x q50" }} ``` -{{< new-in "0.83.0" >}} Webp support was added in Hugo 0.83.0. +{{< new-in "0.83.0" >}} WebP support was added in Hugo 0.83.0. -### Hint {{< new-in "0.83.0" >}} +### Hint -Hint about what type of image this is. Currently only used when encoding to Webp. + {{< new-in "0.83.0" >}} + +Hint about what type of image this is. Currently only used when encoding to WebP. Default value is `photo`. @@ -225,12 +227,14 @@ See https://github.com/disintegration/imaging for more. If you want to trade qua By default the images is encoded in the source format, but you can set the target format as an option. -Valid values are `jpg`, `png`, `tif`, `bmp`, and `gif`. +Valid values are `jpg`, `png`, `tif`, `bmp`, `gif` and `webp`. ```go {{ $image.Resize "600x jpg" }} ``` +{{< new-in "0.83.0" >}} WebP support was added in Hugo 0.83.0. + ## Image Processing Examples _The photo of the sunset used in the examples below is Copyright [Bjørn Erik Pedersen](https://commons.wikimedia.org/wiki/User:Bep) (Creative Commons Attribution-Share Alike 4.0 International license)_ @@ -272,10 +276,10 @@ You can configure an `imaging` section in `config.toml` with default image proce # See https://github.com/disintegration/imaging resampleFilter = "box" -# Default JPEG or WEBP quality setting. Default is 75. +# Default JPEG or WebP quality setting. Default is 75. quality = 75 -# Default hint about what type of image. Currently only used for Webp encoding. +# Default hint about what type of image. Currently only used for WebP encoding. # Default is "photo". # Valid values are "picture", "photo", "drawing", "icon", or "text". hint = "photo" diff --git a/content/en/functions/scratch.md b/content/en/functions/scratch.md index 10623b2cb..cadff5aa0 100644 --- a/content/en/functions/scratch.md +++ b/content/en/functions/scratch.md @@ -1,6 +1,6 @@ --- title: .Scratch -description: Acts as a "scratchpad" to allow for writable page- or shortcode-scoped variables. +description: Acts as a "scratchpad" to store and manipulate data. godocref: date: 2017-02-01 publishdate: 2017-02-01 @@ -20,110 +20,124 @@ draft: false aliases: [/extras/scratch/,/doc/scratch/] --- -In most cases you can do okay without `Scratch`, but due to scoping issues, there are many use cases that aren't solvable in Go Templates without `Scratch`'s help. - -`.Scratch` is available as methods on `Page` and `Shortcode`. Since Hugo 0.43 you can also create a locally scoped `Scratch` using the template func `newScratch`. - +Scratch is a Hugo feature designed to conveniently manipulate data in a Go Template world. It is either a Page or Shortcode method for which the resulting data will be attached to the given context, or it can live as a unique instance stored in a variable. {{% note %}} -See [this Go issue](https://github.com/golang/go/issues/10608) for the main motivation behind Scratch. +Note that Scratch was initially created as a workaround for a [Go template scoping limitation](https://github.com/golang/go/issues/10608) that affected Hugo versions prior to 0.48. For a detailed analysis of `.Scratch` and contextual use cases, see [this blog post](https://regisphilibert.com/blog/2017/04/hugo-scratch-explained-variable/). {{% /note %}} -{{% note %}} -For a detailed analysis of `.Scratch` and in context use cases, see this [post](https://regisphilibert.com/blog/2017/04/hugo-scratch-explained-variable/). -{{% /note %}} +### Contexted `.Scratch` vs. local `newScratch` -## Get a Scratch +Since Hugo 0.43, there are two different ways of using Scratch: -From Hugo `0.43` you can also create a locally scoped `Scratch` by calling `newScratch`: +#### The Page's `.Scratch` + +`.Scratch` is available as a Page method or a Shortcode method and attaches the "scratched" data to the given page. Either a Page or a Shortcode context is required to use `.Scratch`. ```go-html-template -$scratch := newScratch -$scratch.Set "greeting" "Hello" +{{ .Scratch.Set "greeting" "bonjour" }} +{{ range .Pages }} + {{ .Scratch.Set "greeting" (print "bonjour" .Title) }} +{{ end }} ``` -A `Scratch` is also added to both `Page` and `Shortcode`. `Scratch` has the following methods: +#### The local `newScratch` + +{{< new-in "0.43.0" >}} A Scratch instance can also be assigned to any variable using the `newScratch` function. In this case, no Page or Shortcode context is required and the scope of the scratch is only local. The methods detailed below are available from the variable the Scratch instance was assigned to. + +```go-html-template +{{ $data := newScratch }} +{{ $data.Set "greeting" "hola" }} +``` + +### Methods + +A Scratch has the following methods: + +{{% note %}} +Note that the following examples assume a [local Scratch instance](#the-local-newscratch) has been stored in `$scratch`. +{{% /note %}} #### .Set -Set the given value to a given key +Set the value of a given key. ```go-html-template -{{ .Scratch.Set "greeting" "Hello" }} +{{ $scratch.Set "greeting" "Hello" }} ``` + #### .Get -Get the value of a given key + +Get the value of a given key. ```go-html-template -{{ .Scratch.Set "greeting" "Hello" }} +{{ $scratch.Set "greeting" "Hello" }} ---- -{{ .Scratch.Get "greeting" }} > Hello +{{ $scratch.Get "greeting" }} > Hello ``` #### .Add -Will add a given value to existing value of the given key. + +Add 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 -{{ .Scratch.Add "greetings" "Hello" }} -{{ .Scratch.Add "greetings" "Welcome" }} +{{ $scratch.Add "greetings" "Hello" }} +{{ $scratch.Add "greetings" "Welcome" }} ---- -{{ .Scratch.Get "greetings" }} > HelloWelcome +{{ $scratch.Get "greetings" }} > HelloWelcome ``` ```go-html-template -{{ .Scratch.Add "total" 3 }} -{{ .Scratch.Add "total" 7 }} +{{ $scratch.Add "total" 3 }} +{{ $scratch.Add "total" 7 }} ---- -{{ .Scratch.Get "total" }} > 10 +{{ $scratch.Get "total" }} > 10 ``` - ```go-html-template -{{ .Scratch.Add "greetings" (slice "Hello") }} -{{ .Scratch.Add "greetings" (slice "Welcome" "Cheers") }} +{{ $scratch.Add "greetings" (slice "Hello") }} +{{ $scratch.Add "greetings" (slice "Welcome" "Cheers") }} ---- -{{ .Scratch.Get "greetings" }} > []interface {}{"Hello", "Welcome", "Cheers"} +{{ $scratch.Get "greetings" }} > []interface {}{"Hello", "Welcome", "Cheers"} ``` #### .SetInMap -Takes a `key`, `mapKey` and `value` and add a map of `mapKey` and `value` to the given `key`. + +Takes a `key`, `mapKey` and `value` and adds a map of `mapKey` and `value` to the given `key`. ```go-html-template -{{ .Scratch.SetInMap "greetings" "english" "Hello" }} -{{ .Scratch.SetInMap "greetings" "french" "Bonjour" }} +{{ $scratch.SetInMap "greetings" "english" "Hello" }} +{{ $scratch.SetInMap "greetings" "french" "Bonjour" }} ---- -{{ .Scratch.Get "greetings" }} > map[french:Bonjour english:Hello] +{{ $scratch.Get "greetings" }} > map[french:Bonjour english:Hello] ``` #### .GetSortedMapValues -Returns array of values from `key` sorted by `mapKey` + +Return an array of values from `key` sorted by `mapKey`. ```go-html-template -{{ .Scratch.SetInMap "greetings" "english" "Hello" }} -{{ .Scratch.SetInMap "greetings" "french" "Bonjour" }} +{{ $scratch.SetInMap "greetings" "english" "Hello" }} +{{ $scratch.SetInMap "greetings" "french" "Bonjour" }} ---- -{{ .Scratch.GetSortedMapValues "greetings" }} > [Hello Bonjour] +{{ $scratch.GetSortedMapValues "greetings" }} > [Hello Bonjour] ``` + #### .Delete -Removes the given key + +{{< new-in "0.38.0" >}} Remove the given key. ```go-html-template -{{ .Scratch.Delete "greetings" }} +{{ $scratch.Set "greeting" "Hello" }} +---- +{{ $scratch.Delete "greeting" }} ``` #### .Values -`Values` returns the raw backing map. Note that you should just use this method on the locally scoped `Scratch` instances you obtain via `newScratch`, not - `.Page.Scratch` etc., as that will lead to concurrency issues. - -## Scope -The scope of the backing data is global for the given `Page` or `Shortcode`, and spans partial and shortcode includes. - -Note that `.Scratch` from a shortcode will return the shortcode's `Scratch`, which in most cases is what you want. If you want to store it in the page scoped Scratch, then use `.Page.Scratch`. - - +Return the raw backing map. Note that you should only use this method on the locally scoped Scratch instances you obtain via [`newScratch`](#the-local-newscratch), not `.Page.Scratch` etc., as that will lead to concurrency issues. [pagevars]: /variables/page/ diff --git a/content/en/getting-started/usage.md b/content/en/getting-started/usage.md index 2b41ecb45..32c270270 100644 --- a/content/en/getting-started/usage.md +++ b/content/en/getting-started/usage.md @@ -167,6 +167,11 @@ Most Hugo builds are so fast that you may not notice the change unless looking d Hugo injects the LiveReload `