From 657f3456c6e05be436101341bc18417b1c67f276 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Wed, 22 Nov 2023 14:12:40 -0800 Subject: [PATCH] Add new-in tags to select functions and methods --- content/en/functions/collections/Where.md | 4 +++- content/en/functions/global/page.md | 2 ++ content/en/functions/hugo/GoVersion.md | 2 ++ content/en/functions/images/Opacity.md | 2 ++ content/en/functions/images/Process.md | 2 ++ content/en/functions/math/Abs.md | 2 ++ content/en/functions/math/Product.md | 2 ++ content/en/functions/math/Sum.md | 2 ++ content/en/functions/path/BaseName.md | 2 ++ content/en/functions/resources/Copy.md | 2 ++ content/en/functions/strings/ContainsNonSpace.md | 2 ++ content/en/functions/urls/JoinPath.md | 2 ++ content/en/methods/page/Fragments.md | 2 ++ content/en/methods/page/RenderShortcodes.md | 2 ++ content/en/methods/resource/Colors.md | 2 ++ 15 files changed, 31 insertions(+), 1 deletion(-) diff --git a/content/en/functions/collections/Where.md b/content/en/functions/collections/Where.md index 04734f0868..e053ed3d55 100644 --- a/content/en/functions/collections/Where.md +++ b/content/en/functions/collections/Where.md @@ -97,7 +97,7 @@ Use any of the following logical operators: `intersect` : (`bool`) Reports whether the given field value (a slice) contains one or more elements in common with `VALUE`. See [details](/functions/collections/intersect). -`like` +`like` {{< new-in 0.116.0 >}} : (`bool`) Reports whether the given field value matches the regular expression specified in `VALUE`. Use the `like` operator to compare `string` values. The `like` operator returns `false` when comparing other data types to the regular expression. {{% note %}} @@ -188,6 +188,8 @@ For example, to return a collection of pages where any of the terms in the "genr ## Regular expression comparison +{{< new-in 0.116.0 >}} + To return a collection of pages where the "author" page parameter begins with either "victor" or "Victor": ```go-html-template diff --git a/content/en/functions/global/page.md b/content/en/functions/global/page.md index 850efbee0f..e17fb07678 100644 --- a/content/en/functions/global/page.md +++ b/content/en/functions/global/page.md @@ -13,6 +13,8 @@ toc: true aliases: [/functions/page] --- +{{< new-in 0.111.0 >}} + At the top level of a template that receives a `Page` object in context, these are equivalent: ```go-html-template diff --git a/content/en/functions/hugo/GoVersion.md b/content/en/functions/hugo/GoVersion.md index 34c6266bf4..1640c3862e 100644 --- a/content/en/functions/hugo/GoVersion.md +++ b/content/en/functions/hugo/GoVersion.md @@ -10,6 +10,8 @@ action: signatures: [hugo.GoVersion] --- +{{< new-in 0.101.0 >}} + ```go-html-template {{ hugo.GoVersion }} → go1.21.1 ``` diff --git a/content/en/functions/images/Opacity.md b/content/en/functions/images/Opacity.md index c3b09efc42..6a74fd0818 100644 --- a/content/en/functions/images/Opacity.md +++ b/content/en/functions/images/Opacity.md @@ -13,6 +13,8 @@ action: toc: true --- +{{< new-in 0.119.0 >}} + The opacity value must be in the range [0, 1]. A value of `0` produces a transparent image, and a value of `1` produces an opaque image (no transparency). ## Usage diff --git a/content/en/functions/images/Process.md b/content/en/functions/images/Process.md index 14b3936e92..a5e4d88dd2 100644 --- a/content/en/functions/images/Process.md +++ b/content/en/functions/images/Process.md @@ -14,6 +14,8 @@ action: toc: true --- +{{< new-in 0.119.0 >}} + This filter has the same options as the [`Process`] method on a `Resource` object, but using it as a filter may be more effective if you need to apply multiple filters to an image. [`Process`]: /methods/resource/process diff --git a/content/en/functions/math/Abs.md b/content/en/functions/math/Abs.md index 6e907d5645..682b8426f2 100644 --- a/content/en/functions/math/Abs.md +++ b/content/en/functions/math/Abs.md @@ -10,6 +10,8 @@ action: signatures: [math.Abs VALUE] --- +{{< new-in 0.112.0 >}} + ```go-html-template {{ math.Abs -2.1 }} → 2.1 ``` diff --git a/content/en/functions/math/Product.md b/content/en/functions/math/Product.md index 343e9f73d8..d94df4f1b8 100644 --- a/content/en/functions/math/Product.md +++ b/content/en/functions/math/Product.md @@ -15,6 +15,8 @@ action: signatures: [math.Product VALUE...] --- +{{< new-in 0.114.0 >}} + ```go-html-template {{ math.Product 1 (slice 2 3) 4 }} → 24 ``` diff --git a/content/en/functions/math/Sum.md b/content/en/functions/math/Sum.md index ae1419fb35..eba03f72d7 100644 --- a/content/en/functions/math/Sum.md +++ b/content/en/functions/math/Sum.md @@ -14,6 +14,8 @@ action: signatures: [math.Sum VALUE...] --- +{{< new-in 0.114.0 >}} + ```go-html-template {{ math.Sum 1 (slice 2 3) 4 }} → 10 ``` diff --git a/content/en/functions/path/BaseName.md b/content/en/functions/path/BaseName.md index 477c8d3196..4c4340a097 100644 --- a/content/en/functions/path/BaseName.md +++ b/content/en/functions/path/BaseName.md @@ -17,6 +17,8 @@ action: aliases: [/functions/path.basename] --- +{{< new-in 0.101.0 >}} + ```go-html-template {{ path.BaseName "a/news.html" }} → news {{ path.BaseName "news.html" }} → news diff --git a/content/en/functions/resources/Copy.md b/content/en/functions/resources/Copy.md index 9df88b0a0b..f8e962aeed 100644 --- a/content/en/functions/resources/Copy.md +++ b/content/en/functions/resources/Copy.md @@ -9,6 +9,8 @@ action: signatures: [resources.Copy TARGETPATH RESOURCE] --- +{{< new-in 0.100.0 >}} + ```go-html-template {{ with resources.Get "images/a.jpg" }} {{ with resources.Copy "img/new-image-name.jpg" . }} diff --git a/content/en/functions/strings/ContainsNonSpace.md b/content/en/functions/strings/ContainsNonSpace.md index 2c4cb29e1e..188aa14ba6 100644 --- a/content/en/functions/strings/ContainsNonSpace.md +++ b/content/en/functions/strings/ContainsNonSpace.md @@ -16,6 +16,8 @@ action: aliases: [/functions/strings.containsnonspace] --- +{{< new-in 0.111.0 >}} + ```go-html-template {{ strings.ContainsNonSpace "\n" }} → false {{ strings.ContainsNonSpace " " }} → false diff --git a/content/en/functions/urls/JoinPath.md b/content/en/functions/urls/JoinPath.md index 2a7b5ba802..7acecb5068 100644 --- a/content/en/functions/urls/JoinPath.md +++ b/content/en/functions/urls/JoinPath.md @@ -12,6 +12,8 @@ action: aliases: [/functions/urls.joinpath] --- +{{< new-in 0.112.0 >}} + ```go-html-template {{ urls.JoinPath }} → "" (empty string) {{ urls.JoinPath "" }} → / diff --git a/content/en/methods/page/Fragments.md b/content/en/methods/page/Fragments.md index 84bf312efc..bae1c7d039 100644 --- a/content/en/methods/page/Fragments.md +++ b/content/en/methods/page/Fragments.md @@ -11,6 +11,8 @@ action: toc: true --- +{{< new-in 0.111.0 >}} + In a URL, whether absolute or relative, the [fragment] links to an `id` attribute of an HTML element on the page. ```text diff --git a/content/en/methods/page/RenderShortcodes.md b/content/en/methods/page/RenderShortcodes.md index b856802dd7..4636bf8f5b 100644 --- a/content/en/methods/page/RenderShortcodes.md +++ b/content/en/methods/page/RenderShortcodes.md @@ -15,6 +15,8 @@ action: toc: true --- +{{< new-in 0.117.0 >}} + Use this method in shortcode templates to compose a page from multiple content files, while preserving a global context for footnotes and the table of contents. For example: diff --git a/content/en/methods/resource/Colors.md b/content/en/methods/resource/Colors.md index 9eca058fe7..1452d558f7 100644 --- a/content/en/methods/resource/Colors.md +++ b/content/en/methods/resource/Colors.md @@ -9,6 +9,8 @@ action: signatures: [RESOURCE.Colors] --- +{{< new-in 0.104.0 >}} + ```go-html-template {{ with resources.Get "images/a.jpg" }} {{ .Colors }} → [#bebebd #514947 #768a9a #647789 #90725e #a48974]