children: set containerstyle automatically according to style #192

This commit is contained in:
Sören Weber 2022-02-23 12:59:09 +01:00
parent 138e88205c
commit 9793100216
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589

View file

@ -5,6 +5,9 @@
{{- $withDescription := .Get "description" | default false }} {{- $withDescription := .Get "description" | default false }}
{{- $sortTerm := .Get "sort" | lower }} {{- $sortTerm := .Get "sort" | lower }}
{{- $containerstyle := .Get "containerstyle" | default "ul" }} {{- $containerstyle := .Get "containerstyle" | default "ul" }}
{{- if( and (not (eq $style "li") ) (eq $containerstyle "ul" ) ) }}
{{- $containerstyle = "div" }}
{{- end }}
{{ (printf "<%s class=\"children children-%s children-sort-%s\">" $containerstyle $style $sortTerm)|safeHTML }} {{ (printf "<%s class=\"children children-%s children-sort-%s\">" $containerstyle $style $sortTerm)|safeHTML }}
{{- $pages := .Page.Pages }} {{- $pages := .Page.Pages }}