From 5d97b6a18ed21f5e83eea449497866425fbfd1e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 30 Mar 2021 07:55:24 +0200 Subject: [PATCH 1/4] Add slice syntax to sections permalinks config Fixes #8363 --- content/en/content-management/urls.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/content-management/urls.md b/content/en/content-management/urls.md index 4389b1dca..4cba09232 100644 --- a/content/en/content-management/urls.md +++ b/content/en/content-management/urls.md @@ -83,7 +83,7 @@ The following is a list of values that can be used in a `permalink` definition i : the content's section `:sections` -: the content's sections hierarchy +: the content's sections hierarchy. {{< new-in "0.83.0" >}} Since Hugo 0.83 you can use a selection of the sections using _slice syntax_: `:sections[1:]` includes all but the first, `:sections[:last]` includes all but the last, `:sections[last]` includes only the last, `:sections[1:2]` includes section 2 and 3. Note that this slice access will not throw any out-of-bounds errors, so you don't have to be exact. `:title` : the content's title From 250e205523b97b86f89b7a7a94244815006e09ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 9 Apr 2021 07:28:27 +0200 Subject: [PATCH 2/4] Add hugo.IsExtended Fixes #8399 --- content/en/functions/hugo.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/content/en/functions/hugo.md b/content/en/functions/hugo.md index 099a5fa96..78f5018c4 100644 --- a/content/en/functions/hugo.md +++ b/content/en/functions/hugo.md @@ -41,6 +41,9 @@ hugo.CommitHash hugo.BuildDate : the compile date of the current Hugo binary formatted with RFC 3339 e.g. `2002-10-02T10:00:00-05:00` +hugo.IsExtended {{< new-in "0.83.0" >}} +: whether this is the extended Hugo binary. + hugo.IsProduction : returns true if `hugo.Environment` is set to the production environment From 8ae31e701df605c3d0f5d1dd86165de7c04288a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 7 Apr 2021 16:49:34 +0200 Subject: [PATCH 3/4] Add webp image encoding support Fixes #5924 --- .../image-processing/index.md | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/content/en/content-management/image-processing/index.md b/content/en/content-management/image-processing/index.md index a432b9851..8cd00210f 100644 --- a/content/en/content-management/image-processing/index.md +++ b/content/en/content-management/image-processing/index.md @@ -167,14 +167,28 @@ 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 Quality +### JPEG and Webp Quality -Only relevant for JPEG 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. + +### Hint {{< new-in "0.83.0" >}} + +Hint about what type of image this is. Currently only used when encoding to Webp. + +Default value is `photo`. + +Valid values are `picture`, `photo`, `drawing`, `icon`, or `text`. + +```go +{{ $image.Resize "600x webp drawing" }} +``` + ### Rotate Rotates an image by the given angle counter-clockwise. The rotation will be performed first to get the dimensions correct. The main use of this is to be able to manually correct for [EXIF orientation](https://github.com/golang/go/issues/4341) of JPEG images. @@ -258,9 +272,14 @@ You can configure an `imaging` section in `config.toml` with default image proce # See https://github.com/disintegration/imaging resampleFilter = "box" -# Default JPEG 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 is "photo". +# Valid values are "picture", "photo", "drawing", "icon", or "text". +hint = "photo" + # Anchor used when cropping pictures. # Default is "smart" which does Smart Cropping, using https://github.com/muesli/smartcrop # Smart Cropping is content aware and tries to find the best crop for each image. From e1ab0f6ebd592687da017ce3db0359b48e5f32e0 Mon Sep 17 00:00:00 2001 From: hugoreleaser Date: Tue, 20 Apr 2021 11:02:48 +0000 Subject: [PATCH 4/4] releaser: Add release notes to /docs for release of 0.82.1 [ci skip] --- content/en/news/0.82.1-relnotes/index.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 content/en/news/0.82.1-relnotes/index.md diff --git a/content/en/news/0.82.1-relnotes/index.md b/content/en/news/0.82.1-relnotes/index.md new file mode 100644 index 000000000..63781799a --- /dev/null +++ b/content/en/news/0.82.1-relnotes/index.md @@ -0,0 +1,19 @@ + +--- +date: 2021-04-20 +title: "Hugo 0.82.1: A couple of Bug Fixes" +description: "This version fixes a couple of bugs introduced in 0.82.0." +categories: ["Releases"] +images: +- images/blog/hugo-bug-poster.png + +--- + + + +This is a bug-fix release with one important fix. + +* Regression in media type suffix lookup [6e9d2bf0](https://github.com/gohugoio/hugo/commit/6e9d2bf0c936900f8f676d485098755b3f463373) [@bep](https://github.com/bep) [#8406](https://github.com/gohugoio/hugo/issues/8406) + + +