mirror of https://github.com/docker/docs.git
Merge pull request #21465 from dvdksn/hugo-use-shortcode-store
hugo: replace Shortcode.Scratch with Shortcode.Store
This commit is contained in:
commit
3326f3bc7f
|
@ -244,7 +244,7 @@ module:
|
|||
proxy: https://proxy.golang.org,direct
|
||||
hugoVersion:
|
||||
extended: false
|
||||
min: "0.124.1"
|
||||
min: "0.139.0"
|
||||
mounts:
|
||||
- source: assets
|
||||
target: assets
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
{{ $name := trim (.Get "name") " " }}
|
||||
|
||||
{{ if not (.Parent.Scratch.Get "tabs") }}
|
||||
{{ .Parent.Scratch.Set "tabs" slice }}
|
||||
{{ if not (.Parent.Store.Get "tabs") }}
|
||||
{{ .Parent.Store.Set "tabs" slice }}
|
||||
{{ end }}
|
||||
{{ with .Inner }}
|
||||
{{ $.Parent.Scratch.Add "tabs" (dict "name" $name "content" . ) }}
|
||||
{{ $.Parent.Store.Add "tabs" (dict "name" $name "content" . ) }}
|
||||
{{ end }}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{ with .Inner }}{{/* don't do anything, just call it */}}{{ end }}
|
||||
{{ $first := urlize (index (.Scratch.Get "tabs") 0).name }}
|
||||
{{ $first := urlize (index (.Store.Get "tabs") 0).name }}
|
||||
{{ $group := .Get "group" }}
|
||||
{{ $groupID := fmt.Printf "tabgroup-%s" (urlize $group) }}
|
||||
{{ $persist := .Get "persist" }}
|
||||
|
@ -19,7 +19,7 @@
|
|||
{{ end }}
|
||||
aria-role="tabpanel">
|
||||
<div aria-role="tablist" class="space-x-2">
|
||||
{{ range (.Scratch.Get "tabs") }}
|
||||
{{ range (.Store.Get "tabs") }}
|
||||
<button
|
||||
class="p-1"
|
||||
:class="selected === '{{ .name | urlize }}' &&
|
||||
|
@ -37,7 +37,7 @@
|
|||
</div>
|
||||
<hr class="!mt-0" />
|
||||
<div>
|
||||
{{ range (.Scratch.Get "tabs") }}
|
||||
{{ range (.Store.Get "tabs") }}
|
||||
<div
|
||||
aria-role="tab"
|
||||
:class="selected !== '{{ .name | urlize }}' && 'hidden'"
|
||||
|
|
Loading…
Reference in New Issue