You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/_common/scratch-pad-scope.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ _comment: Do not remove front matter.
4
4
5
5
## Scope
6
6
7
-
The method or function used to create a scratch pad determines its scope. For example, use the `Store` method on a `Page` object to create a scratch pad scoped to the page.
7
+
The method or function used to create the data structure determines its scope. For example, use the `Store` method on a `Page` object to create a data structure scoped to the page.
The method or function used to create the data structure determines its scope. For example, use the `Store` method on a `Page` object to create a data structure scoped to the page.
Copy file name to clipboardExpand all lines: content/en/content-management/content-adapters.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ Use these methods within a content adapter.
85
85
> Methods that depend on built pages, such as `Site.Pages`, are unavailable at this stage and return an error.
86
86
87
87
`Store`
88
-
: (`maps.Scratch`) Returns a persistent "scratch pad" to store and manipulate data. The main use case for this is to transfer values between executions when [EnableAllLanguages](#enablealllanguages) is set. See [examples](/methods/page/store/).
88
+
: (`maps.Scratch`) Returns a persistent data structure for storing and manipulating keyed values. The main use case for this is to transfer values between executions when [EnableAllLanguages](#enablealllanguages) is set. See [examples](/methods/page/store/).
Copy file name to clipboardExpand all lines: content/en/functions/collections/NewScratch.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: collections.NewScratch
3
-
description: Returns a locally scoped "scratch pad" to store and manipulate data.
3
+
description: Returns a locally scoped persistent data structure for storing and manipulating keyed values.
4
4
categories: []
5
5
keywords: []
6
6
params:
@@ -10,11 +10,11 @@ params:
10
10
signatures: [collections.NewScratch]
11
11
---
12
12
13
-
Use the `collections.NewScratch` function to create a locally scoped [scratch pad](g) to store and manipulate data. To create a scratch pad with a different [scope](g), refer to the [scope](#scope) section below.
13
+
Use the `collections.NewScratch` function to create a locally scoped persistent data structure for storing and manipulating keyed values. To create a data structure with a different [scope](g), refer to the [scope](#scope) section below.
14
14
15
15
## Methods
16
16
17
-
Use these methods on the scratch pad.
17
+
Use these methods on the data structure.
18
18
19
19
`Set`
20
20
: Sets the value of the given key.
@@ -110,4 +110,4 @@ Use these methods on the scratch pad.
Copy file name to clipboardExpand all lines: content/en/functions/hugo/Store.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: hugo.Store
3
-
description: Returns a globally scoped "scratch pad" to store and manipulate data.
3
+
description: Returns a globally scoped persistent data structure for storing and manipulating keyed values.
4
4
categories: []
5
5
keywords: []
6
6
params:
@@ -11,11 +11,11 @@ params:
11
11
12
12
{{< new-in 0.139.0 />}}
13
13
14
-
Use the `hugo.Store` function to create a globally scoped [scratch pad](g) to store and manipulate data. To create a scratch pad with a different [scope](g), refer to the [scope](#scope) section below.
14
+
Use the `hugo.Store` function to create a globally scoped persistent data structure for storing and manipulating keyed values. To create a data structure with a different [scope](g), refer to the [scope](#scope) section below.
15
15
16
16
## Methods
17
17
18
-
Use these methods on the scratch pad.
18
+
Use these methods on the data structure.
19
19
20
20
`Set`
21
21
: Sets the value of the given key.
@@ -91,13 +91,13 @@ Use these methods on the scratch pad.
91
91
{{ hugo.Store.Delete "greeting" }}
92
92
```
93
93
94
-
{{% include "_common/scratch-pad-scope.md" %}}
94
+
{{% include "_common/store-scope.md" %}}
95
95
96
96
## Determinate values
97
97
98
-
The `Store` method is often used to set scratch pad values within a _shortcode_ template, a _partial_ template called by a _shortcode_ template, or by a _render hook_ template. In all three cases, the scratch pad values are indeterminate until Hugo renders the page content.
98
+
The `Store` method is often used to set values within a _shortcode_ template, a _partial_ template called by a _shortcode_ template, or by a _render hook_ template. In all three cases, the stored values are indeterminate until Hugo renders the page content.
99
99
100
-
If you need to access a scratch pad value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a [noop](g) variable:
100
+
If you need to access a stored value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a [noop](g) variable:
Use the `Store` method on a `Page` object to create a [scratch pad](g) to store and manipulate data, scoped to the current page. To create a scratch pad with a different [scope](g), refer to the [scope](#scope) section below.
13
+
Use the `Store` method on a `Page` object to create a persistent data structure for storing and manipulating keyed values, scoped to the current page. To create a data structure with a different [scope](g), refer to the [scope](#scope) section below.
14
14
15
15
{{% include "_common/store-methods.md" %}}
16
16
17
-
{{% include "_common/scratch-pad-scope.md" %}}
17
+
{{% include "_common/store-scope.md" %}}
18
18
19
19
## Determinate values
20
20
21
-
The `Store` method is often used to set scratch pad values within a _shortcode_ template, a _partial_ template called by a _shortcode_ template, or by a _render hook_ template. In all three cases, the scratch pad values are indeterminate until Hugo renders the page content.
21
+
The `Store` method is often used to set values within a _shortcode_ template, a _partial_ template called by a _shortcode_ template, or by a _render hook_ template. In all three cases, the stored values are indeterminate until Hugo renders the page content.
22
22
23
-
If you need to access a scratch pad value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a [noop](g) variable:
23
+
If you need to access a stored value from a parent template, and the parent template has not yet rendered the page content, you can trigger content rendering by assigning the returned value to a [noop](g) variable:
description: Returns a "scratch pad" to store and manipulate data, scoped to the current shortcode.
3
+
description: Returns a persistent data structure for storing and manipulating keyed values, scoped to the current shortcode.
4
4
categories: []
5
5
keywords: []
6
6
params:
@@ -11,14 +11,14 @@ params:
11
11
12
12
{{< new-in 0.139.0 />}}
13
13
14
-
Use the `Store` method to create a [scratch pad](g) to store and manipulate data, scoped to the current shortcode. To create a scratch pad with a different [scope](g), refer to the [scope](#scope) section below.
14
+
Use the `Store` method to create a persistent data structure for storing and manipulating keyed values, scoped to the current shortcode. To create a data structure with a different [scope](g), refer to the [scope](#scope) section below.
15
15
16
16
> [!note]
17
17
> With the introduction of the [`newScratch`] function, and the ability to [assign values to template variables] after initialization, the `Store` method within a shortcode is mostly obsolete.
0 commit comments