File tree Expand file tree Collapse file tree
exampleSite/content.en/docs/shortcodes/experimental Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,10 @@ Enhanced image display with click-to-expand behavior.
1010
1111## Example
1212
13- {{< image src="placeholder.svg" alt="Placeholder image" title="Click to expand" loading="lazy" >}}
13+ {{% columns %}}
14+ - {{< image src="placeholder.svg" alt="Placeholder image" title="Click to expand" loading="lazy" >}}
15+ - {{< image src="placeholder.svg" alt="Placeholder image" title="Click to expand" loading="lazy" >}}
16+ {{% /columns %}}
1417
1518## Parameters
1619
Original file line number Diff line number Diff line change 1+ {{- $key := printf "book-%s-id" .Name }}
2+ {{- .Page.Store.Add $key 1 -}}
3+ {{- return .Page.Store.Get $key -}}
Original file line number Diff line number Diff line change 77 < script defer src ="{{ "asciinema /asciinema-auto.js" | relURL }}"> </ script >
88 {{- .Page.Store.Set "asciinema" true -}}
99{{- end -}}
10+ {{- $id := partial "docs/text/shortcode-id" . -}}
1011{{- $href := (partial "docs/links/portable-image" (dict "Page" .Page "Destination" (.Get "cast"))) -}}
1112{{- .Store.Set "asciinema" .Params -}}
1213{{- .Store.DeleteInMap "asciinema" "cast" -}}
1314{{- $attributes := partial "docs/text/mapper" (dict
1415 "attributes" (dict)
1516 "set" (dict
16- "id" (printf "asciinema-%d" .Ordinal )
17+ "id" (printf "asciinema-%d" ($id) )
1718 "x-data-cast" $href
1819 "x-data-opts" (.Store.Get "asciinema" | jsonify)
1920 )
Original file line number Diff line number Diff line change 11{{- $ratio := (split (.Get "ratio") ":") -}}
2+ {{- $id := partial "docs/text/shortcode-id" . -}}
23{{- if strings.Contains .InnerDeindent "< --- > " -}}
34{{- warnf "{{< columns > }} shortcode separator '< --- > ' is deprecated, use markdown list instead." -}}
45{{- $attributes := partial "docs/text/mapper" (dict
56 "attributes" (cond .IsNamedParams .Params dict)
67 "merge" (dict
78 "class" (slice "book-columns" "flex" "flex-wrap")
8- "id" (printf "book-columns-%d" .Ordinal )
9+ "id" (printf "book-columns-%d" $id )
910 )
1011) -}}
1112< div {{ partial "docs/html-attrs" $attributes | safeHTMLAttr }}>
1920{{- else -}}
2021{{- if .Get "ratio" -}}
2122< style > {{- range $index, $grow : = $ratio - }}
22- # book-columns- {{ $. Ordinal }}> ul > li : nth-child ({{ $index | add 1 }}) {
23+ # book-columns- {{ $id }}> ul> li: nth-child ({{ $index | add 1 }}) {
2324 flex- grow: {{ default 1 $grow }};
2425}
2526{{ end - }}
2930 "attributes" (cond .IsNamedParams .Params dict)
3031 "merge" (dict
3132 "class" (slice "book-columns")
32- "id" (printf "book-columns-%d" .Ordinal )
33+ "id" (printf "book-columns-%d" $id )
3334 )
3435) -}}
3536< div {{ partial "docs/html-attrs" $attributes | safeHTMLAttr }}>
Original file line number Diff line number Diff line change 33 "attributes" (cond .IsNamedParams .Params dict)
44 "keep" (slice "id" "class" "tabindex" "alt" "title" "loading")
55) -}}
6- < label class =" book-image " for =" book-image-toggle-{{ .Ordinal }} " >
7- < input class ="hidden toggle " type =" checkbox " id =" book-image-toggle-{{ .Ordinal }} " />
8- < img src =" {{ $destination | safeURL }} " {{ partial "docs/html-attrs" $attributes | safeHTMLAttr }} />
9- </ label >
10- {{- /* remove whitespaces */ -}}
6+ {{- $id := partial "docs/text/shortcode-id" . -}}
7+ < label class ="book-image " for =" book-image-toggle-{{ $id }} "> {{- /* remove whitespaces */ -}}
8+ < input class =" hidden toggle " type =" checkbox " id =" book-image-toggle- {{ $id }} " /> {{- /* remove whitespaces */ -}}
9+ < img src =" {{ $destination | safeURL }} " {{ partial "docs/html-attrs" $attributes | safeHTMLAttr }} /> {{- /* remove whitespaces */ -}}
10+ </ label > {{- /* remove whitespaces */ -}}
Original file line number Diff line number Diff line change 1- {{- $group := printf "tabs-%v" .Parent.Ordinal -}}
1+ {{- $group := printf "tabs-%v" ( .Parent.Store.Get "id") -}}
22{{- $tab := printf "%s-%d" $group .Ordinal -}}
33< input type ="radio " class ="toggle " name ="{{ $group }} " id ="{{ $tab }} " {{ if not .Ordinal }}checked ="checked "{{ end }} />
44{{- /* remove whitespaces */ -}}
Original file line number Diff line number Diff line change 1+ {{- .Store.Set "id" (partial "docs/text/shortcode-id" .) -}}
12{{- $attributes := partial "docs/text/mapper" (dict
23 "attributes" (cond .IsNamedParams .Params dict)
34 "merge" (dict
You can’t perform that action at this time.
0 commit comments