diff --git a/layouts/shortcodes/columns.html b/layouts/shortcodes/columns.html index 5a7bb62..ecb68a9 100644 --- a/layouts/shortcodes/columns.html +++ b/layouts/shortcodes/columns.html @@ -6,9 +6,9 @@
- {{ range split .Inner "<--->" }} + {{- range split .Inner "<--->" }}
{{ . | $.Page.RenderString }}
- {{ end }} + {{- end }}
diff --git a/layouts/shortcodes/tab.html b/layouts/shortcodes/tab.html index 4eb1b44..90b2727 100644 --- a/layouts/shortcodes/tab.html +++ b/layouts/shortcodes/tab.html @@ -1,12 +1,12 @@ -{{ if .Parent }} - {{ $name := .Get 0 }} - {{ $group := printf "tabs-%s" (.Parent.Get 0) }} +{{- if .Parent }} + {{- $name := .Get 0 }} + {{- $group := printf "tabs-%s" (.Parent.Get 0) }} - {{ if not (.Parent.Scratch.Get $group) }} - {{ .Parent.Scratch.Set $group slice }} - {{ end }} + {{- if not (.Parent.Scratch.Get $group) }} + {{- .Parent.Scratch.Set $group slice }} + {{- end }} - {{ .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }} -{{ else }} + {{- .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }} +{{- else }} {{ errorf "%q: 'tab' shortcode must be inside 'tabs' shortcode" .Page.Path }} -{{ end }} +{{- end }} diff --git a/layouts/shortcodes/tabs.html b/layouts/shortcodes/tabs.html index 660b14d..7d8671e 100644 --- a/layouts/shortcodes/tabs.html +++ b/layouts/shortcodes/tabs.html @@ -1,10 +1,10 @@ -{{ if .Inner }}{{ end }} -{{ $id := .Get 0 }} -{{ $group := printf "tabs-%s" $id }} +{{- if .Inner }}{{ end }} +{{- $id := .Get 0 }} +{{- $group := printf "tabs-%s" $id }}
- {{ range $index, $tab := .Scratch.Get $group }} + {{- range $index, $tab := .Scratch.Get $group }} {{ .Content | $.Page.RenderString }}
- {{ end }} + {{- end }}