diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-10-30 09:50:15 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-10-30 09:50:15 +0100 |
commit | 3553fc533a868d0303214e3ae53558e23d09b438 (patch) | |
tree | 58b62b3af796986303c838b88eb34e9544939043 /docs/content/en/functions/strings.Repeat.md | |
parent | 173187e2633f3fc037c83e1e3de2902ae3c93b92 (diff) | |
parent | 9cabb46f68bae01aeb1859727dcb21e8a10f5ec7 (diff) | |
download | hugo-3553fc533a868d0303214e3ae53558e23d09b438.tar.gz hugo-3553fc533a868d0303214e3ae53558e23d09b438.zip |
Merge commit '9cabb46f68bae01aeb1859727dcb21e8a10f5ec7'
Diffstat (limited to 'docs/content/en/functions/strings.Repeat.md')
-rw-r--r-- | docs/content/en/functions/strings.Repeat.md | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/docs/content/en/functions/strings.Repeat.md b/docs/content/en/functions/strings.Repeat.md index 8dcb8eaa2..3ad4626fb 100644 --- a/docs/content/en/functions/strings.Repeat.md +++ b/docs/content/en/functions/strings.Repeat.md @@ -1,7 +1,7 @@ --- title: strings.Repeat # linktitle: -description: Returns a string consisting of count copies of the string s. +description: Returns INPUT repeated COUNT times. godocref: date: 2018-05-31 publishdate: 2018-05-31 @@ -11,21 +11,14 @@ menu: docs: parent: "functions" keywords: [strings] -signature: ["strings.Repeat INPUT COUNT"] +signature: ["strings.Repeat COUNT INPUT"] workson: [] hugoversion: relatedfuncs: [] deprecated: false --- -`strings.Repeat` provides the Go [`strings.Repeat`](https://golang.org/pkg/strings/#Repeat) function for Hugo templates. It takes a string and a count, and returns a string with consisting of count copies of the string argument. - -``` -{{ strings.Repeat "yo" 3 }} → "yoyoyo" -``` - -`strings.Repeat` *requires* the second argument, which tells the function how many times to repeat the first argument; there is no default. However, it can be used as a pipeline: - ``` +{{ strings.Repeat 3 "yo" }} → "yoyoyo" {{ "yo" | strings.Repeat 3 }} → "yoyoyo" ``` |