Use "map" instead of "dictionary"

This commit is contained in:
Joe Mooring authored and GitHub committed 2023-08-08 08:01:07 -07:00
1 parent 704dd5da68
commit cacd0e461d
6 files changed
+7 -9

No files matched your search

@@ -390,7 +390,7 @@ This article has 101 words.
### Query a singular/plural translation ### Query a singular/plural translation
In other to meet singular/plural requirement, you must pass a dictionary (map) with a numeric `.Count` property to the `i18n` function. The below example uses `.ReadingTime` variable which has a built-in `.Count` property. To enable pluralization when translating, pass a map with a numeric `.Count` property to the `i18n` function. The example below uses `.ReadingTime` variable which has a built-in `.Count` property.
```go-html-template ```go-html-template
{{ i18n "readingTime" .ReadingTime }} {{ i18n "readingTime" .ReadingTime }}
+2 -2
View File
@@ -1,11 +1,11 @@
--- ---
title: dict title: dict
description: Creates a dictionary from a list of key and value pairs. description: Creates a map from a list of key and value pairs.
categories: [functions] categories: [functions]
menu: menu:
docs: docs:
parent: functions parent: functions
keywords: [dictionary] keywords: [collections]
signature: ["dict KEY VALUE [KEY VALUE]..."] signature: ["dict KEY VALUE [KEY VALUE]..."]
relatedfuncs: [] relatedfuncs: []
--- ---
+1 -1
View File
@@ -6,7 +6,7 @@ menu:
docs: docs:
parent: functions parent: functions
keywords: [] keywords: []
signature: ["echoParam DICTIONARY KEY"] signature: ["echoParam MAP KEY"]
relatedfuncs: [] relatedfuncs: []
--- ---
+1 -1
View File
@@ -39,7 +39,7 @@ The above will overlay `$logo` in the upper left corner of `$img` (at position `
Using the `Text` filter, you can add text to an image. Using the `Text` filter, you can add text to an image.
{{% funcsig %}} {{% funcsig %}}
images.Text TEXT DICT) images.Text TEXT MAP)
{{% /funcsig %}} {{% /funcsig %}}
The following example will add the text `Hugo rocks!` to the image with the specified color, size and position. The following example will add the text `Hugo rocks!` to the image with the specified color, size and position.
+1 -3
View File
@@ -10,9 +10,7 @@ signature: ["jsonify INPUT", "jsonify OPTIONS INPUT"]
relatedfuncs: [plainify] relatedfuncs: [plainify]
--- ---
Jsonify encodes a given object to JSON. To customize the printing of the JSON, pass a map of options as the first
To customize the printing of the JSON, pass a dictionary of options as the first
argument. Supported options are "prefix" and "indent". Each JSON element in argument. Supported options are "prefix" and "indent". Each JSON element in
the output will begin on a new line beginning with *prefix* followed by one or the output will begin on a new line beginning with *prefix* followed by one or
more copies of *indent* according to the indentation nesting. more copies of *indent* according to the indentation nesting.
+1 -1
View File
@@ -5,7 +5,7 @@ categories: [functions]
menu: menu:
docs: docs:
parent: functions parent: functions
keywords: [dictionary] keywords: [collections]
signature: ["collections.Merge MAP MAP...", "merge MAP MAP..."] signature: ["collections.Merge MAP MAP...", "merge MAP MAP..."]
relatedfuncs: [dict, append, reflect.IsMap, reflect.IsSlice] relatedfuncs: [dict, append, reflect.IsMap, reflect.IsSlice]
--- ---