mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-11-14 23:19:21 +00:00
feat: improve feature image presentation
This commit is contained in:
1 parent
53a64328d7
commit
af0e11171c
8 files changed
+49
-14
No files matched your search
@@ -11,6 +11,9 @@
|
||||
{{ $thumbnailAspectRatio := site.Params.thumbnailAspectRatio | default "1.5" }}
|
||||
{{ $thumbnailAspectRatio = replaceRE "[^0-9.]" "" $thumbnailAspectRatio }}
|
||||
{{ if eq $thumbnailAspectRatio "" }}{{ $thumbnailAspectRatio = "1.5" }}{{ end }}
|
||||
{{ $featureImageHover := site.Params.list.featureImageHover | default false }}
|
||||
{{ if isset .Params "featureImageHover" }}{{ $featureImageHover = .Params.featureImageHover }}{{ end }}
|
||||
{{ $featureImagePosition := .Params.imagePositionFeature | default site.Params.imagePositionFeature | default site.Params.imagePosition }}
|
||||
{{ if not .Params.hideFeatureImage }}
|
||||
{{/* frontmatter */}}
|
||||
{{ with $page }}
|
||||
@@ -64,17 +67,19 @@
|
||||
|
||||
|
||||
<article
|
||||
class="article-link--card relative min-h-full min-w-full overflow-hidden rounded-lg border border-neutral-300 dark:border-neutral-600">
|
||||
class="article-link--card group relative min-h-full min-w-full overflow-hidden rounded-lg border border-neutral-300 dark:border-neutral-600">
|
||||
{{ with $featuredURL }}
|
||||
<div
|
||||
class="flex-none relative overflow-hidden thumbnail_card"
|
||||
style="--thumbnail-aspect-ratio: {{ $thumbnailAspectRatio }}">
|
||||
<img
|
||||
src="{{ . }}"
|
||||
role="presentation"
|
||||
alt="{{ $page.Title }}"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
class="not-prose absolute inset-0 w-full h-full object-cover" />
|
||||
fetchpriority="low"
|
||||
class="not-prose absolute inset-0 h-full w-full object-cover transition duration-500 {{ if $featureImageHover }}group-hover:scale-105{{ end }}"
|
||||
{{ with $featureImagePosition }}style="object-position: {{ . }};"{{ end }} />
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ if and .Draft .Site.Params.article.showDraftLabel }}
|
||||
|
||||
Reference in new issue
Block a user