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 `