mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 15:31:52 +00:00
e3194eca1e
The `.Params.images` and `.Site.Params.images` have existed since the creation of the files
but have never been referenced in the documentation since their initial commit (3cc1569fc1)
Also, Meta tags are not valid inside card elements
64 lines
2.6 KiB
HTML
64 lines
2.6 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 }}
|
|
{{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg") }}
|
|
{{ with . }}
|
|
<div
|
|
class="thumbnail_card_related nozoom w-full"
|
|
style="background-image:url({{ .RelPermalink }});"></div>
|
|
{{ end }}
|
|
{{ else }}
|
|
{{ with .Resize "600x" }}
|
|
<div
|
|
class="thumbnail_card_related nozoom w-full"
|
|
style="background-image:url({{ .RelPermalink }});"></div>
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ 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>
|