Files
docker-docs/layouts/shortcodes/grid.html
David Karlsson d01789c386 hugo: add support for specifying grid columns
Converts the grid shortcode to use named arguments, and adds support for
a second "cols" argument for specifying grid size (3 by default).

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2023-11-09 15:39:51 +01:00

9 lines
410 B
HTML

{{ $cols := .Get "cols" | default 3 }}
<div class="not-prose grid grid-cols-{{ $cols }} xl:grid-cols-{{ sub $cols 1 }} gap-4 sm:flex sm:flex-col">
{{ $items := index .Page.Params (.Get "items" | default "grid") }}
{{ range $items }}
{{ $opts := dict "title" .title "link" .link "description" .description "icon" .icon "image" .image }}
{{ partial "components/card.html" $opts }}
{{ end }}
</div>