mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Merge commit 'a024bc7d76fcc5e49e8210f9b0896db9ef21861a'
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user