{{/* Image card shortcode - creates a clickable card with image and title Usage: {{< image-card image="images/ai-cube.svg" alt="AI Redis icon" title="Redis vector database quick start guide" url="/develop/get-started/vector-database" >}} Parameters: - image: Path to the image file (required) - alt: Alt text for the image (required) - title: Title text to display below the image (required) - url: URL to link to when clicked (required) - class: Optional CSS class for the card container */}} {{ $image := .Get "image" }} {{ $alt := .Get "alt" }} {{ $title := .Get "title" }} {{ $url := .Get "url" }} {{ $class := .Get "class" | default "" }} {{/* Handle internal vs external URLs */}} {{ $finalUrl := $url }} {{ if and (not (hasPrefix $url "http")) (not (hasPrefix $url "//")) }} {{ $finalUrl = relref . $url }} {{ end }}
{{ $alt }}
{{ $title }}