mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-08 06:14:54 -04:00
Add new-in tags to select functions and methods
This commit is contained in:
parent
5c41f0bf81
commit
e699eb313b
@ -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
|
||||
|
@ -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
|
||||
|
@ -10,6 +10,8 @@ action:
|
||||
signatures: [hugo.GoVersion]
|
||||
---
|
||||
|
||||
{{< new-in 0.101.0 >}}
|
||||
|
||||
```go-html-template
|
||||
{{ hugo.GoVersion }} → go1.21.1
|
||||
```
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -10,6 +10,8 @@ action:
|
||||
signatures: [math.Abs VALUE]
|
||||
---
|
||||
|
||||
{{< new-in 0.112.0 >}}
|
||||
|
||||
```go-html-template
|
||||
{{ math.Abs -2.1 }} → 2.1
|
||||
```
|
||||
|
@ -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
|
||||
```
|
||||
|
@ -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
|
||||
```
|
||||
|
@ -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
|
||||
|
@ -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" . }}
|
||||
|
@ -16,6 +16,8 @@ action:
|
||||
aliases: [/functions/strings.containsnonspace]
|
||||
---
|
||||
|
||||
{{< new-in 0.111.0 >}}
|
||||
|
||||
```go-html-template
|
||||
{{ strings.ContainsNonSpace "\n" }} → false
|
||||
{{ strings.ContainsNonSpace " " }} → false
|
||||
|
@ -12,6 +12,8 @@ action:
|
||||
aliases: [/functions/urls.joinpath]
|
||||
---
|
||||
|
||||
{{< new-in 0.112.0 >}}
|
||||
|
||||
```go-html-template
|
||||
{{ urls.JoinPath }} → "" (empty string)
|
||||
{{ urls.JoinPath "" }} → /
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user