mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-04 20:30:44 +00:00
20 lines
674 B
HTML
20 lines
674 B
HTML
{{ if .Parent }}
|
|
{{- $group := printf "grid-%s" (.Parent.Get 0) }}
|
|
{{- $class := default "" (.Get "class") }}
|
|
{{- $size := default "regular" (.Get "size" | lower) }}
|
|
{{- $icon := default "" (.Get "icon") }}
|
|
{{- $title := default "" (.Get "title") }}
|
|
|
|
{{- if not (in (slice "regular" "large") $size) }}
|
|
{{- $size = "regular" }}
|
|
{{- end }}
|
|
|
|
{{ if not (.Parent.Scratch.Get $group) }}
|
|
{{ .Parent.Scratch.Set $group slice }}
|
|
{{ end }}
|
|
|
|
{{ .Parent.Scratch.Add $group (dict "Class" $class "Size" $size "Icon" $icon "Title" $title "Content" .Inner) }}
|
|
{{ else }}
|
|
{{ errorf "%q: 'box' shortcode must be inside 'boxes' shortcode" .Page.Path }}
|
|
{{ end }}
|