|
| 1 | +{{/* |
| 2 | + Copyright © 2025 The Hinode Team / Mark Dumay. All rights reserved. |
| 3 | + Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file. |
| 4 | + Visit gethinode.com/license for more details. |
| 5 | +*/}} |
| 6 | + |
| 7 | +{{ $error := false }} |
| 8 | + |
| 9 | +{{/* Initialize arguments */}} |
| 10 | +{{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "cards" "args" .)}} |
| 11 | +{{ if or $args.err $args.warnmsg }} |
| 12 | + {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict |
| 13 | + "partial" "component-library/components/cards/cards.hugo.html" |
| 14 | + "warnid" "warn-invalid-arguments" |
| 15 | + "msg" "Invalid arguments" |
| 16 | + "details" ($args.errmsg | append $args.warnmsg) |
| 17 | + "file" page.File |
| 18 | + )}} |
| 19 | + {{ $error = $args.err }} |
| 20 | +{{ end }} |
| 21 | + |
| 22 | +{{/* Initialize local variables */}} |
| 23 | +{{ $list := slice }} |
| 24 | +{{ range $args.elements }} |
| 25 | + <!-- TODO: check mode --> |
| 26 | + {{ $list = $list | append (dict |
| 27 | + "title" .title |
| 28 | + "description" (.content | page.RenderString) |
| 29 | + "icon" .icon |
| 30 | + "thumbnail" .image |
| 31 | + ) }} |
| 32 | +{{ end}} |
| 33 | + |
| 34 | +{{ if not $error }} |
| 35 | + <div class="container-xxl p-4 px-xxl-0"> |
| 36 | + {{- partial "assets/section-title.html" (dict "heading" $args.heading "class" "py-5") -}} |
| 37 | + |
| 38 | + {{- partial "assets/card-group.html" (dict |
| 39 | + "page" page |
| 40 | + "list" $list |
| 41 | + "class" (printf "border-0 card-icon-primary d-sm-none %s" $args.class) |
| 42 | + "cols" $args.cols |
| 43 | + "gutter" "4" |
| 44 | + "padding" $args.padding |
| 45 | + "header-style" "none" |
| 46 | + "footer-style" "none" |
| 47 | + "icon-rounded" $args.iconRounded |
| 48 | + "icon-style" "fa-2x" |
| 49 | + "align" "start" |
| 50 | + "orientation" ($args.orientation | default "horizontal-sm") |
| 51 | + "hook" "assets/live-card.html" |
| 52 | + ) -}} |
| 53 | + |
| 54 | + {{- partial "assets/card-group.html" (dict |
| 55 | + "page" page |
| 56 | + "list" $list |
| 57 | + "class" (printf "border-0 card-icon-primary d-none d-sm-block %s" $args.class) |
| 58 | + "cols" $args.cols |
| 59 | + "gutter" "4" |
| 60 | + "padding" $args.padding |
| 61 | + "header-style" "none" |
| 62 | + "footer-style" "none" |
| 63 | + "icon-rounded" $args.iconRounded |
| 64 | + "icon-style" "fa-2x" |
| 65 | + "align" "start" |
| 66 | + "orientation" ($args.orientation | default "stacked") |
| 67 | + "hook" "assets/live-card.html" |
| 68 | + ) -}} |
| 69 | + </div> |
| 70 | +{{ end }} |
| 71 | + |
0 commit comments