{{- $page := .page -}} {{- $link := .link -}} {{- $title := .title -}} {{- $icon := .icon -}} {{- $subtitle := .subtitle -}} {{- $image := .image -}} {{- $width := .width -}} {{- $height := .height -}} {{- $imageStyle := .imageStyle -}} {{- $tag := .tag -}} {{- $tagType := .tagType -}} {{ $linkClass := "hover:hx-border-gray-300 hx-bg-transparent hx-shadow-sm dark:hx-border-neutral-800 hover:hx-bg-slate-50 hover:hx-shadow-md dark:hover:hx-border-neutral-700 dark:hover:hx-bg-neutral-900" }} {{- with $image -}} {{ $linkClass = "hover:hx-border-gray-300 hx-bg-gray-100 hx-shadow dark:hx-border-neutral-700 dark:hx-bg-neutral-800 dark:hx-text-gray-50 hover:hx-shadow-lg dark:hover:hx-border-neutral-500 dark:hover:hx-bg-neutral-700" }} {{- end -}} {{- $external := strings.HasPrefix $link "http" -}} {{- $href := cond (strings.HasPrefix $link "/") ($link | relURL) $link -}} {{- with $image -}} {{ $title }} {{- end -}} {{- $padding := "hx-p-4" -}} {{- with $subtitle -}} {{- $padding = "hx-pt-4 hx-px-4" -}} {{- end -}} {{- with $icon }}{{ partial "utils/icon.html" (dict "name" $icon) -}}{{- end -}} {{- $title -}} {{- with $subtitle -}}
{{- $subtitle | markdownify -}}
{{- end -}} {{- if $tag }} {{ $defaultClass := "hx-text-gray-600 hx-text-xxs hx-bg-gray-100 dark:hx-bg-neutral-800 dark:hx-text-neutral-200" }} {{ $warningClass := "hx-border-yellow-100 hx-bg-yellow-50 hx-text-yellow-900 dark:hx-border-yellow-200/30 dark:hx-bg-yellow-700/30 dark:hx-text-yellow-200" }} {{ $infoClass := "hx-border-blue-200 hx-bg-blue-100 hx-text-blue-900 dark:hx-border-blue-200/30 dark:hx-bg-blue-900/30 dark:hx-text-blue-200" }} {{ $errorClass := "hx-border-red-200 hx-bg-red-100 hx-text-red-900 dark:hx-border-red-200/30 dark:hx-bg-red-900/30 dark:hx-text-red-200" }} {{ $tagClass := cond (eq $tagType "info") $infoClass (cond (eq $tagType "warning") $warningClass (cond (eq $tagType "error") $errorClass $defaultClass)) }}
{{ $tag }}
{{- end -}}
{{- /* Strip trailing newline. */ -}}