Merge commit 'a024bc7d76fcc5e49e8210f9b0896db9ef21861a'

This commit is contained in:
Bjørn Erik Pedersen
2025-02-13 10:40:34 +01:00
817 changed files with 5301 additions and 14766 deletions

View File

@@ -1,7 +1,6 @@
---
title: Store
linktitle: site.Store
description: Returns a persistent "scratch pad" on the given site to store and manipulate data.
description: Returns a "scratch pad" to store and manipulate data, scoped to the current site.
categories: []
keywords: []
action:
@@ -14,12 +13,9 @@ action:
toc: true
---
{{< new-in 0.139.0 >}}
{{< new-in 0.139.0 />}}
The `Store` method on a `Site` object creates a persistent [scratch pad](g) to store and manipulate data. To create a locally scoped scratch pad that is not attached to a `Site` object, use the [`newScratch`] function.
[`Scratch`]: /methods/site/scratch/
[`newScratch`]: /functions/collections/newscratch/
Use the `Store` method on a `Site` object to create a [scratch pad](g) to store and manipulate data, scoped to the current site. To create a scratch pad with a different [scope](g), refer to the [scope](#scope) section below.
## Methods
@@ -104,6 +100,8 @@ Removes the given key.
{{ site.Store.Delete "greeting" }}
```
{{% include "_common/scratch-pad-scope.md" %}}
## Determinate values
The `Store` method is often used to set scratch pad values within a shortcode, a partial template called by a shortcode, or by a Markdown render hook. In all three cases, the scratch pad values are indeterminate until Hugo renders the page content.