mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-16 20:53:59 +02:00
Merge commit 'a024bc7d76fcc5e49e8210f9b0896db9ef21861a'
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
---
|
||||
title: Scratch
|
||||
description: Returns a "scratch pad" scoped to the shortcode to store and manipulate data.
|
||||
description: Returns a "scratch pad" to store and manipulate data, scoped to the current shortcode.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- functions/collections/NewScratch
|
||||
related: []
|
||||
returnType: maps.Scratch
|
||||
signatures: [SHORTCODE.Scratch]
|
||||
expiryDate: 2025-11-18 # deprecated 2024-11-18
|
||||
expiryDate: 2026-11-18 # deprecated 2024-11-18 (soft)
|
||||
---
|
||||
|
||||
{{% deprecated-in 0.139.0 %}}
|
||||
@@ -20,14 +19,3 @@ Beginning with v0.139.0 the `SHORTCODE.Scratch` method is aliased to `SHORTCODE.
|
||||
|
||||
[`SHORTCODE.Store`]: /methods/shortcode/store/
|
||||
{{% /deprecated-in %}}
|
||||
|
||||
The `Scratch` method within a shortcode creates a [scratch pad](g) 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 `Scratch` method within a shortcode is obsolete.
|
||||
|
||||
[assign values to template variables]: https://go.dev/doc/go1.11#text/template
|
||||
[`newScratch`]: /functions/collections/newscratch/
|
||||
{{% /note %}}
|
||||
|
||||
{{% include "methods/page/_common/scratch-methods.md" %}}
|
||||
|
@@ -1,21 +1,22 @@
|
||||
---
|
||||
title: Store
|
||||
description: Returns a "Store pad" scoped to the shortcode to store and manipulate data.
|
||||
description: Returns a "scratch pad" to store and manipulate data, scoped to the current shortcode.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- functions/collections/NewScratch
|
||||
- methods/page/Store
|
||||
- methods/site/Store
|
||||
- functions/hugo/Store
|
||||
returnType: maps.Store
|
||||
- functions/collections/NewScratch
|
||||
returnType: maps.Scratch
|
||||
signatures: [SHORTCODE.Store]
|
||||
toc: true
|
||||
---
|
||||
|
||||
{{< new-in 0.139.0 >}}
|
||||
{{< new-in 0.139.0 />}}
|
||||
|
||||
The `Store` method within a shortcode creates a [scratch pad](g) to store and manipulate data. The scratch pad is scoped to the shortcode.
|
||||
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.
|
||||
|
||||
{{% 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.
|
||||
@@ -24,4 +25,6 @@ With the introduction of the [`newScratch`] function, and the ability to [assign
|
||||
[`newScratch`]: /functions/collections/newScratch/
|
||||
{{% /note %}}
|
||||
|
||||
{{% include "methods/page/_common/scratch-methods.md" %}}
|
||||
{{% include "_common/store-methods.md" %}}
|
||||
|
||||
{{% include "_common/scratch-pad-scope.md" %}}
|
||||
|
@@ -7,6 +7,7 @@ keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: methods
|
||||
aliases: [/variables/shortcodes]
|
||||
---
|
||||
|
||||
Use these methods in your shortcode templates.
|
||||
|
Reference in New Issue
Block a user