hugo-geekblog/layouts/shortcodes/boxes.html

26 lines
819 B
HTML
Raw Normal View History

2022-07-11 12:37:17 +00:00
{{- if .Inner }}{{ end }}
{{- $id := .Get 0 }}
{{- $group := printf "grid-%s" $id }}
<div class="flex flex-gap flex-fill">
{{- range $index, $box := .Scratch.Get $group }}
<div
class="flex justify-center gblog-box gblog-box--{{ $box.Size }}
2022-07-11 12:37:17 +00:00
{{ with $box.Class }}{{ printf " %s" . }}{{ end }}"
>
{{ if or $box.Title $box.Icon }}
<div class="flex align-center justify-center gblog-box__title">
{{- with $box.Icon }}
<svg class="gblog-icon {{ . }}"><use xlink:href="#{{ . }}"></use></svg>
{{- end }}
{{ with $box.Title }}<span>{{ . }}</span>{{ end }}
</div>
{{ end }}
<div class="flex align-center justify-center gblog-box__text">
{{ .Content | $.Page.RenderString }}
</div>
</div>
{{- end }}
</div>