feat: add optional alt parameter to card shortcode (#899)
Add support for custom alt text on card images to improve accessibility. The alt parameter is optional and defaults to the card title if not provided, maintaining backward compatibility with existing implementations. Fixes #896
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
{{- $icon := .icon -}}
|
||||
{{- $subtitle := .subtitle -}}
|
||||
{{- $image := .image -}}
|
||||
{{- $alt := .alt | default $title -}}
|
||||
{{- $width := .width -}}
|
||||
{{- $height := .height -}}
|
||||
{{- $imageStyle := .imageStyle -}}
|
||||
@@ -29,7 +30,7 @@
|
||||
>
|
||||
{{- with $image -}}
|
||||
<img
|
||||
alt="{{ $title }}"
|
||||
alt="{{ $alt }}"
|
||||
class="hextra-card-image"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
|
||||
Reference in New Issue
Block a user