mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-11-02 00:59:44 +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
@@ -34,6 +34,9 @@
|
||||
{{ $page := $target }}
|
||||
{{ $featured := "" }}
|
||||
{{ $featuredURL := "" }}
|
||||
{{ $featureImageHover := site.Params.list.featureImageHover | default false }}
|
||||
{{ if isset $target.Params "featureImageHover" }}{{ $featureImageHover = $target.Params.featureImageHover }}{{ end }}
|
||||
{{ $featureImagePosition := $target.Params.imagePositionFeature | default site.Params.imagePositionFeature | default site.Params.imagePosition }}
|
||||
{{ if not $target.Params.hideFeatureImage }}
|
||||
{{/* frontmatter */}}
|
||||
{{ with $page }}
|
||||
@@ -86,15 +89,17 @@
|
||||
{{ end }}
|
||||
|
||||
|
||||
<article class="article-link--shortcode {{ $cardClasses }}">
|
||||
<article class="article-link--shortcode group {{ $cardClasses }}">
|
||||
{{ with $featuredURL }}
|
||||
<div class="flex-none relative overflow-hidden {{ $imgWrapperClasses }} thumbnail">
|
||||
<img
|
||||
src="{{ . }}"
|
||||
role="presentation"
|
||||
alt="{{ $target.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 }}
|
||||
<div class="{{ $cardContentClasses }}">
|
||||
|
||||
Reference in new issue
Block a user