Miscellaneous updates

This commit is contained in:
Joe Mooring authored and GitHub committed 2023-11-05 13:12:09 -08:00
1 parent 80b2241f9e
commit 508666575f
37 files changed
+204 -440

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@ This shortcode performs error checking, then renders an HTML `img` element with
{{ $src = . }}
{{ with resources.Get $src }}
{{ $id := printf "img-%03d" $.Ordinal }}
<img id="{{ $id }}" src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
<img id="{{ $id }}" src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
{{ else }}
{{ errorf "The %q shortcode was unable to find %s. See %s" $.Name $src $.Position }}
{{ end }}
+2 -2
View File
@@ -10,12 +10,12 @@ action:
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.
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
[assign values to template variables]: https://go.dev/doc/go1.11#text/template
[`newScratch`]: functions/collections/newscratch
{{% /note %}}