mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
56 lines
2.5 KiB
HTML
56 lines
2.5 KiB
HTML
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
|
|
<div
|
|
class="group-hover-card group relative min-h-full min-w-full overflow-hidden rounded border border-2 border-neutral-200 shadow-2xl dark:border-neutral-700">
|
|
<a
|
|
{{ partial "article-link/_external-link.html" . | safeHTMLAttr }}
|
|
class="absolute inset-0"
|
|
aria-label="{{ $.Title }}"></a>
|
|
|
|
{{ $images := $.Resources.ByType "image" }}
|
|
{{ $featured := $images.GetMatch "*feature*" }}
|
|
{{ if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end }}
|
|
{{ if and .Params.featureimage (not $featured) }}
|
|
{{ $url:= .Params.featureimage }}
|
|
{{ $featured = resources.GetRemote $url }}
|
|
{{ end }}
|
|
{{ if not $featured }}
|
|
{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}
|
|
{{ end }}
|
|
{{ with $featured }}
|
|
{{ $featuredURL := .RelPermalink }}
|
|
{{ if not (or $disableImageOptimization (eq .MediaType.SubType "svg")) }}
|
|
{{ $featuredURL = (.Resize "600x").RelPermalink }}
|
|
{{ end }}
|
|
<div class="thumbnail_card_related nozoom w-full" style="background-image:url({{ $featuredURL }});"></div>
|
|
{{ end }}
|
|
{{ if and .Draft .Site.Params.article.showDraftLabel }}
|
|
<span class="absolute top-0 right-0 m-2">
|
|
{{ partial "badge.html" (i18n "article.draft" | emojify) }}
|
|
</span>
|
|
{{ end }}
|
|
<div class="px-6 py-4">
|
|
{{ with .Params.externalUrl }}
|
|
<div
|
|
class="group-hover-card-title decoration-primary-500 dark:text-neutral text-xl font-bold text-neutral-800 group-hover:underline group-hover:underline-offset-2">
|
|
{{ $.Title | emojify }}
|
|
<span class="cursor-default align-top text-xs text-neutral-400 dark:text-neutral-500">
|
|
<span class="rtl:hidden">↗</span>
|
|
<span class="ltr:hidden">↖</span>
|
|
</span>
|
|
</div>
|
|
{{ else }}
|
|
<div
|
|
class="group-hover-card-title decoration-primary-500 dark:text-neutral text-xl font-bold text-neutral-800 group-hover:underline group-hover:underline-offset-2">
|
|
{{ .Title | emojify }}
|
|
</div>
|
|
{{ end }}
|
|
<div class="group-hover-cancel text-sm text-neutral-500 dark:text-neutral-400">
|
|
{{ partial "article-meta/basic.html" . }}
|
|
</div>
|
|
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
|
|
<div class="prose dark:prose-invert py-1">{{ .Summary | plainify }}</div>
|
|
{{ end }}
|
|
</div>
|
|
<div class="px-6 pt-4 pb-2"></div>
|
|
</div>
|