2023-09-26 08:15:31 +01:00
|
|
|
{{- $title := .Get "title" -}}
|
|
|
|
{{- $subtitle := .Get "subtitle" -}}
|
|
|
|
{{- $class := .Get "class" -}}
|
|
|
|
{{- $image := .Get "image" -}}
|
|
|
|
{{- $imageClass := .Get "imageClass" -}}
|
|
|
|
{{- $style := .Get "style" -}}
|
|
|
|
{{- $icon := .Get "icon" -}}
|
2023-10-27 05:13:24 +07:00
|
|
|
{{- $link := .Get "link" -}}
|
2023-09-26 08:15:31 +01:00
|
|
|
|
2023-10-27 05:13:24 +07:00
|
|
|
{{- $external := hasPrefix $link "http" -}}
|
|
|
|
{{- $href := cond (strings.HasPrefix $link "/") ($link | relURL) $link -}}
|
2023-09-26 08:15:31 +01:00
|
|
|
|
2023-11-10 12:45:44 -05:00
|
|
|
{{- if hasPrefix $image "/" -}}
|
|
|
|
{{- $image = relURL (strings.TrimPrefix "/" $image) -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2023-10-27 05:13:24 +07:00
|
|
|
<a
|
|
|
|
{{ with $link }}href="{{ $href }}" {{ with $external }} target="_blank" rel="noreferrer"{{ end }}{{ end }}
|
2023-09-26 08:15:31 +01:00
|
|
|
{{ with $style }}style="{{ . | safeCSS }}"{{ end }}
|
2025-03-29 12:51:42 +00:00
|
|
|
class="{{ $class }} hextra-feature-card not-prose hx:block hx:relative hx:overflow-hidden hx:rounded-3xl hx:border hx:border-gray-200 hx:hover:border-gray-300 hx:dark:border-neutral-800 hx:dark:hover:border-neutral-700 hx:before:pointer-events-none hx:before:absolute hx:before:inset-0 hx:before:bg-glass-gradient"
|
2023-09-26 08:15:31 +01:00
|
|
|
>
|
2025-03-29 12:51:42 +00:00
|
|
|
<div class="hx:relative hx:w-full hx:p-6">
|
|
|
|
<h3 class="hx:text-2xl hx:font-medium hx:leading-6 hx:mb-2 hx:flex hx:items-center">
|
2023-09-26 08:15:31 +01:00
|
|
|
{{ with $icon -}}
|
2025-03-29 12:51:42 +00:00
|
|
|
<span class="hx:pr-2">
|
2023-09-26 08:15:31 +01:00
|
|
|
{{- partial "utils/icon.html" (dict "name" . "attributes" "height=1.5rem") -}}
|
|
|
|
</span>
|
|
|
|
{{ end -}}
|
|
|
|
<span>{{ $title }}</span>
|
|
|
|
</h3>
|
2025-03-29 12:51:42 +00:00
|
|
|
<p class="hx:text-gray-500 hx:dark:text-gray-400 hx:text-sm hx:leading-6">{{ $subtitle | markdownify }}</p>
|
2023-09-26 08:15:31 +01:00
|
|
|
</div>
|
|
|
|
{{- with $image -}}
|
2025-03-29 12:51:42 +00:00
|
|
|
<img src="{{ . }}" class="hx:absolute hx:max-w-none {{ $imageClass }}" alt="{{ $title }}" />
|
2023-09-26 08:15:31 +01:00
|
|
|
{{- end -}}
|
2023-10-27 05:13:24 +07:00
|
|
|
</a>
|