noveria.org/layouts/partials/content/card.html
2025-02-27 20:37:24 +01:00

21 lines
1.1 KiB
HTML

<article class="relative group rounded-3xl">
<figure class="w-full aspect-video overflow-hidden rounded-3xl">
{{- if .Params.image }}
<a class="insert-link" href="{{ .RelPermalink }}">
{{- if (strings.HasPrefix .Params.image "http") }}
<img class="object-cover group-hover:scale-105 transition duration-500 cursor-pointer" src="{{ .Params.image }}" alt="{{ $.Name }}" style="width: 100%; height: 100%; object-fit: cover;">
{{- else }}
{{- with $imgcard := resources.Get .Params.image -}}
{{- $imgcard := $imgcard.Process "resize 750x" -}}
<img class="object-cover group-hover:scale-105 transition duration-500 cursor-pointer" src="{{ $imgcard.Permalink }}" alt="{{ $.Name }}" width="{{ $imgcard.Width }}" height="{{ $imgcard.Height }}">
{{- end }}
{{- end }}
</a>
{{- end }}
</figure>
<div class="p-6">
<small>{{ .Date | time.Format ":date_long" }}</small>
<h3 class="my-4 text-2xl font-bold group-hover:underline">{{ .Title }}</h3>
<p class="text-normal leading-normal text-zinc-500 line-clamp-2">{{ .Params.description }}</p>
</div>
</article>