Add new-in tags to select functions and methods

This commit is contained in:
Joe Mooring 2023-11-22 14:13:37 -08:00 committed by GitHub
parent 5c41f0bf81
commit e699eb313b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 31 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -10,6 +10,8 @@ action:
signatures: [hugo.GoVersion]
---
{{< new-in 0.101.0 >}}
```go-html-template
{{ hugo.GoVersion }} → go1.21.1
```

View File

@ -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

View File

@ -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

View File

@ -10,6 +10,8 @@ action:
signatures: [math.Abs VALUE]
---
{{< new-in 0.112.0 >}}
```go-html-template
{{ math.Abs -2.1 }} → 2.1
```

View File

@ -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
```

View File

@ -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
```

View File

@ -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

View File

@ -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" . }}

View File

@ -16,6 +16,8 @@ action:
aliases: [/functions/strings.containsnonspace]
---
{{< new-in 0.111.0 >}}
```go-html-template
{{ strings.ContainsNonSpace "\n" }} → false
{{ strings.ContainsNonSpace " " }} → false

View File

@ -12,6 +12,8 @@ action:
aliases: [/functions/urls.joinpath]
---
{{< new-in 0.112.0 >}}
```go-html-template
{{ urls.JoinPath }} → "" (empty string)
{{ urls.JoinPath "" }} → /

View File

@ -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

View File

@ -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:

View File

@ -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]