mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-19 14:15:47 +00:00
Miscellaneous updates
This commit is contained in:
1 parent
80b2241f9e
commit
508666575f
37 files changed
+204
-440
No files matched your search
@@ -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 }}
|
||||
|
||||
@@ -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 %}}
|
||||
|
||||
|
||||
Reference in new issue
Block a user