feat(card): add tagIcon and tagBorder options (#791)

This commit is contained in:
Ludovic Fernandez
2025-08-25 17:49:06 +02:00
committed by GitHub
parent c149af0f74
commit 22f81e2470
5 changed files with 32 additions and 18 deletions

View File

@@ -8,6 +8,8 @@
{{- $imageStyle := .imageStyle -}}
{{- $tag := .tag -}}
{{- $tagColor := .tagColor | default .tagType | default "" -}}{{- /* Compatibility with previous parameter. */ -}}
{{- $tagBorder := not (eq .tagBorder false) | default true }}
{{- $tagIcon := .tagIcon -}}
{{ $linkClass := "hx:hover:border-gray-300 hx:bg-transparent hx:shadow-xs hx:dark:border-neutral-800 hx:hover:bg-slate-50 hx:hover:shadow-md hx:dark:hover:border-neutral-700 hx:dark:hover:bg-neutral-900" }}
{{- with $image -}}
@@ -57,7 +59,8 @@
"content" $tag
"color" $tagColor
"class" "hextra-card-tag"
"border" true
"border" $tagBorder
"icon" $tagIcon
)
-}}
{{- end -}}

View File

@@ -25,6 +25,8 @@ A shortcode to create a card.
{{- $imageStyle := .Get "imageStyle" -}}
{{- $tag := .Get "tag" -}}
{{- $tagColor := .Get "tagColor" | default (.Get "tagType") | default "" -}}{{- /* Compatibility with previous parameter. */ -}}
{{- $tagBorder := not (eq (.Get "tagBorder") false) | default true }}
{{- $tagIcon := .Get "tagIcon" | default "" -}}
{{/* Image processing options */}}
{{- $method := .Get "method" | default "Resize" | humanize -}}
@@ -61,5 +63,7 @@ A shortcode to create a card.
"imageStyle" $imageStyle
"tag" $tag
"tagType" $tagColor
"tagBorder" $tagBorder
"tagIcon" $tagIcon
)
-}}