mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Merge commit 'e477373487abcccdbed95688e37aa74b9b8fc198'
This commit is contained in:
29
docs/content/en/methods/shortcode/Store.md
Normal file
29
docs/content/en/methods/shortcode/Store.md
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
title: Store
|
||||
description: Returns a "Store pad" scoped to the shortcode to store and manipulate data.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- functions/collections/NewScratch
|
||||
- methods/page/Store
|
||||
- methods/site/Store
|
||||
- functions/hugo/Store
|
||||
returnType: maps.Store
|
||||
signatures: [SHORTCODE.Store]
|
||||
---
|
||||
|
||||
{{< new-in 0.139.0 >}}
|
||||
|
||||
The `Store` method within a shortcode creates a [scratch pad] to store and manipulate data. The scratch pad is scoped to the shortcode.
|
||||
|
||||
{{% note %}}
|
||||
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.
|
||||
|
||||
[assign values to template variables]: https://go.dev/doc/go1.11#text/template
|
||||
[`newScratch`]: /functions/collections/newScratch/
|
||||
{{% /note %}}
|
||||
|
||||
[Store pad]: /getting-started/glossary/#scratch-pad
|
||||
|
||||
{{% include "methods/page/_common/scratch-methods.md" %}}
|
Reference in New Issue
Block a user