|
29 | 29 | {{- $color := .color -}} |
30 | 30 | {{- $description := .description -}} |
31 | 31 | {{- $links := .links -}} |
| 32 | + {{- $class := .class }} |
32 | 33 |
|
33 | 34 | {{- if $href -}} |
34 | | - <a href="{{ $href }}" class="{{ if $color }}link-bg-{{ $color }}{{ else }}card-body-link{{ end }} stretched-link"> |
| 35 | + <a href="{{ $href }}" class="{{ if $color }}link-bg-{{ $color }}{{ else }}card-body-link{{ end }} stretched-link {{ $class }}"> |
35 | 36 | {{ if or $title $links }} |
36 | 37 | <p class="card-title fs-lg-5 fs-6"> |
37 | 38 | {{- with $title }}{{ . | page.RenderString }}{{ end }} |
|
45 | 46 | {{ end -}} |
46 | 47 | </a> |
47 | 48 | {{- else -}} |
48 | | - <div> |
| 49 | + <div{{ with $class }} class="{{ . }}"{{ end }}> |
49 | 50 | {{ if or $title $links }} |
50 | 51 | <p class="card-title fs-lg-5 fs-6"> |
51 | 52 | {{- with $title }}{{ . | page.RenderString }}{{ end }} |
|
208 | 209 | </div> |
209 | 210 | {{- end -}} |
210 | 211 | <div class="{{ $col2 }}"> |
211 | | - <div class="card-body p-{{ $args.padding }} h-100 hstack"> |
| 212 | + {{ $padding := printf "p-%d%s" $args.padding (cond (and (eq $args.padding 0) (or $icon $thumbnail)) " ps-3" "") }} |
| 213 | + <div class="card-body {{ $padding }} h-100 hstack"> |
212 | 214 | {{ if $icon }} |
213 | 215 | {{- partial "assets/card-icon.html" (dict |
214 | 216 | "icon" $icon |
|
219 | 221 | )}} |
220 | 222 | {{ end }} |
221 | 223 | <div> |
222 | | - {{ if $page }} |
| 224 | + {{ if and $page (ne $args.headerStyle "none") }} |
223 | 225 | <div>{{ partial "inline/card-caption.html" (dict |
224 | 226 | "page" $page |
225 | 227 | "keywords" $args.headerStyle |
|
234 | 236 | "description" $description |
235 | 237 | "links" $args.links |
236 | 238 | ) -}} |
237 | | - {{ if $page }}<div>{{ partial "inline/card-caption.html" (dict "page" $page "keywords" $args.footerStyle "color" $args.color) }}</div>{{ end }} |
| 239 | + {{ if and $page (ne $args.footerStyle "none") }} |
| 240 | + <div>{{ partial "inline/card-caption.html" (dict |
| 241 | + "page" $page |
| 242 | + "keywords" $args.footerStyle |
| 243 | + "color" $args.color) |
| 244 | + }} |
| 245 | + </div> |
| 246 | + {{ end }} |
238 | 247 | {{ if and $href $args.button }} |
239 | 248 | {{ $label := (or $args.buttonLabel $title) | default (T "readMore") }} |
240 | 249 | {{ $buttonClass := "card-button mb-n4" }} |
|
284 | 293 | "color" $args.color |
285 | 294 | "description" $description |
286 | 295 | "links" $args.links |
| 296 | + "class" (cond (and $thumbnail (eq $args.headerStyle "none")) "pt-3" "") |
287 | 297 | ) -}} |
288 | 298 | {{ if $page }}{{- partial "inline/card-caption.html" (dict "page" $page "keywords" $args.footerStyle "color" $args.color) -}}{{ end }} |
289 | 299 | </div> |
|
0 commit comments