mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-21 20:50:40 +00:00
fix: fix rendering of nested shortcodes in tabs (#363)
This commit is contained in:
parent
e1c6517723
commit
1b203a991c
@ -6,9 +6,9 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="gblog-columns gblog-columns--{{ $size }} flex flex-gap flex-mobile-column">
|
<div class="gblog-columns gblog-columns--{{ $size }} flex flex-gap flex-mobile-column">
|
||||||
{{ range split .Inner "<--->" }}
|
{{- range split .Inner "<--->" }}
|
||||||
<div class="gblog-columns__content gblog-markdown--nested flex-even">
|
<div class="gblog-columns__content gblog-markdown--nested flex-even">
|
||||||
{{ . | $.Page.RenderString }}
|
{{ . | $.Page.RenderString }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
{{ if .Parent }}
|
{{- if .Parent }}
|
||||||
{{ $name := .Get 0 }}
|
{{- $name := .Get 0 }}
|
||||||
{{ $group := printf "tabs-%s" (.Parent.Get 0) }}
|
{{- $group := printf "tabs-%s" (.Parent.Get 0) }}
|
||||||
|
|
||||||
{{ if not (.Parent.Scratch.Get $group) }}
|
{{- if not (.Parent.Scratch.Get $group) }}
|
||||||
{{ .Parent.Scratch.Set $group slice }}
|
{{- .Parent.Scratch.Set $group slice }}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
|
|
||||||
{{ .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }}
|
{{- .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }}
|
||||||
{{ else }}
|
{{- else }}
|
||||||
{{ errorf "%q: 'tab' shortcode must be inside 'tabs' shortcode" .Page.Path }}
|
{{ errorf "%q: 'tab' shortcode must be inside 'tabs' shortcode" .Page.Path }}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{{ if .Inner }}{{ end }}
|
{{- if .Inner }}{{ end }}
|
||||||
{{ $id := .Get 0 }}
|
{{- $id := .Get 0 }}
|
||||||
{{ $group := printf "tabs-%s" $id }}
|
{{- $group := printf "tabs-%s" $id }}
|
||||||
|
|
||||||
|
|
||||||
<div class="gblog-tabs">
|
<div class="gblog-tabs">
|
||||||
{{ range $index, $tab := .Scratch.Get $group }}
|
{{- range $index, $tab := .Scratch.Get $group }}
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
class="gblog-tabs__control hidden"
|
class="gblog-tabs__control hidden"
|
||||||
@ -18,5 +18,5 @@
|
|||||||
<div class="gblog-markdown--nested gblog-tabs__content">
|
<div class="gblog-markdown--nested gblog-tabs__content">
|
||||||
{{ .Content | $.Page.RenderString }}
|
{{ .Content | $.Page.RenderString }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user