mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-15 04:18:46 +00:00
Namespace functions and methods
This commit is contained in:
1 parent
40212779ae
commit
723a827fdc
687 files changed
+20449
-5821
No files matched your search
@@ -0,0 +1,24 @@
|
||||
---
|
||||
title: Scratch
|
||||
description: Creates a "scratch pad" scoped to the shortcode to store and manipulate data.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related:
|
||||
- functions/collections/NewScratch
|
||||
returnType: maps.Scratch
|
||||
signatures: [SHORTCODE.Scratch]
|
||||
---
|
||||
|
||||
The `Scratch` method within a shortcode creates a [scratch pad] to store and manipulate data. The scratch pad is scoped to the shortcode, and is reset on server rebuilds.
|
||||
|
||||
{{% 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 variables]: https://go.dev/doc/go1.11#text/template
|
||||
[`newScratch`]: functions/collections/newscratch
|
||||
{{% /note %}}
|
||||
|
||||
[scratch pad]: /getting-started/glossary/#scratch-pad
|
||||
|
||||
{{% include "methods/page/_common/scratch-methods.md" %}}
|
||||
Reference in new issue
Block a user