Files
hinode/layouts/shortcodes/card-group.html
2024-06-26 19:22:38 +02:00

67 lines
2.2 KiB
HTML

<!--
Copyright © 2024 The Hinode Team / Mark Dumay. All rights reserved.
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
Visit gethinode.com/license for more details.
-->
<!-- Validate arguments -->
{{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "card-group" "child" "card" "args" .Params) }}
{{- errorf "partial [assets/card.html] - Invalid arguments" -}}
{{ end }}
<!-- Initialize arguments and default values -->
{{- $cols := .Get "cols" | default "3" -}}
{{- $gutter := .Get "gutter" | default "4" -}}
{{- $title := .Get "title" | default "" -}}
{{- $separator := .Get "separator" | default "" -}}
{{- $wrapper := .Get "wrapper" | default "" -}}
{{- $responsive := .Get "responsive" | default true -}}
<!-- Initialize arguments passed to individual cards -->
{{- $class := .Get "class" | default "" -}}
{{- $color := .Get "color" | default "" -}}
{{- $padding := .Get "padding" | default "auto" -}}
{{- $header := .Get "header" | default "" -}}
{{- $footer := .Get "footer" | default "" -}}
{{- $orientation := .Get "orientation" | default "" -}}
{{- $align := .Get "align" | default "start" -}}
{{- $style := .Get "style" | default "" -}}
{{- $subtle := .Get "subtle" | default false -}}
{{- $button := .Get "button" | default false -}}
{{- $buttonType := .Get "buttonType" | default "" -}}
{{- $iconRounded := .Get "iconRounded" | default false -}}
{{- $scroll := .Get "scroll" | default false -}}
{{ $inner := .Scratch.Get "inner" }}
{{ $input := trim .Inner " \r\n" }}
{{ if $input }}
{{ $input = replace $input "\n" "\n " }}
{{ warnf "Unexpected inner content: %s\r\n %s" .Position $input }}
{{ end }}
<!-- Main code -->
{{- partial "assets/card-group.html" (dict
"page" .Page
"cards" $inner
"cols" $cols
"gutter" $gutter
"title" $title
"separator" $separator
"wrapper" $wrapper
"responsive" $responsive
"class" $class
"color" $color
"padding" $padding
"header" $header
"footer" $footer
"orientation" $orientation
"align" $align
"style" $style
"subtle" $subtle
"button" $button
"buttonType" $buttonType
"iconRounded" $iconRounded
"scroll" $scroll
)
-}}