mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'
This commit is contained in:
@@ -3,11 +3,11 @@ title: math.Counter
|
||||
description: Increments and returns a global counter.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
aliases: []
|
||||
related: []
|
||||
returnType: uint64
|
||||
signatures: [math.Counter]
|
||||
params:
|
||||
functions_and_methods:
|
||||
aliases: []
|
||||
returnType: uint64
|
||||
signatures: [math.Counter]
|
||||
---
|
||||
|
||||
The counter is global for both monolingual and multilingual sites, and its initial value for each build is 1.
|
||||
@@ -27,9 +27,7 @@ Use this function to:
|
||||
- Create unique warnings as shown above; the [`warnf`] function suppresses duplicate messages
|
||||
- Create unique target paths for the `resources.FromString` function where the target path is also the cache key
|
||||
|
||||
[`warnf`]: /functions/fmt/warnf/
|
||||
[`resources.FromString`]: /functions/resources/fromstring/
|
||||
> [!note]
|
||||
> Due to concurrency, the value returned in a given template for a given page will vary from one build to the next. You cannot use this function to assign a static id to each page.
|
||||
|
||||
{{% note %}}
|
||||
Due to concurrency, the value returned in a given template for a given page will vary from one build to the next. You cannot use this function to assign a static id to each page.
|
||||
{{% /note %}}
|
||||
[`warnf`]: /functions/fmt/warnf/
|
||||
|
Reference in New Issue
Block a user