Skip to content

Commit 3326f3b

Browse files
authored
Merge pull request #21465 from dvdksn/hugo-use-shortcode-store
hugo: replace Shortcode.Scratch with Shortcode.Store
2 parents 4c24f72 + f805149 commit 3326f3b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

hugo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ module:
244244
proxy: https://proxy.golang.org,direct
245245
hugoVersion:
246246
extended: false
247-
min: "0.124.1"
247+
min: "0.139.0"
248248
mounts:
249249
- source: assets
250250
target: assets

layouts/shortcodes/tab.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
{{ $name := trim (.Get "name") " " }}
66

7-
{{ if not (.Parent.Scratch.Get "tabs") }}
8-
{{ .Parent.Scratch.Set "tabs" slice }}
7+
{{ if not (.Parent.Store.Get "tabs") }}
8+
{{ .Parent.Store.Set "tabs" slice }}
99
{{ end }}
1010
{{ with .Inner }}
11-
{{ $.Parent.Scratch.Add "tabs" (dict "name" $name "content" . ) }}
11+
{{ $.Parent.Store.Add "tabs" (dict "name" $name "content" . ) }}
1212
{{ end }}

layouts/shortcodes/tabs.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{ with .Inner }}{{/* don't do anything, just call it */}}{{ end }}
2-
{{ $first := urlize (index (.Scratch.Get "tabs") 0).name }}
2+
{{ $first := urlize (index (.Store.Get "tabs") 0).name }}
33
{{ $group := .Get "group" }}
44
{{ $groupID := fmt.Printf "tabgroup-%s" (urlize $group) }}
55
{{ $persist := .Get "persist" }}
@@ -19,7 +19,7 @@
1919
{{ end }}
2020
aria-role="tabpanel">
2121
<div aria-role="tablist" class="space-x-2">
22-
{{ range (.Scratch.Get "tabs") }}
22+
{{ range (.Store.Get "tabs") }}
2323
<button
2424
class="p-1"
2525
:class="selected === '{{ .name | urlize }}' &&
@@ -37,7 +37,7 @@
3737
</div>
3838
<hr class="!mt-0" />
3939
<div>
40-
{{ range (.Scratch.Get "tabs") }}
40+
{{ range (.Store.Get "tabs") }}
4141
<div
4242
aria-role="tab"
4343
:class="selected !== '{{ .name | urlize }}' && 'hidden'"

0 commit comments

Comments
 (0)