Skip to content

Commit 70895c3

Browse files
André DietrichAndré Dietrich
authored andcommitted
optimized card image preview
1 parent 0c60bab commit 70895c3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

themes/hugoplate/layouts/partials/components/blog-card.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
{{- if not (hasPrefix $image "http") -}}
66
{{- $resourcePath := strings.TrimPrefix "/" $image -}}
77
{{- with resources.Get $resourcePath -}}
8-
{{- $resized := .Fill "400x234 q85" -}}
8+
{{- $resized := .Fill "400x200 q85" -}}
99
{{- $imageUrl = $resized.RelPermalink -}}
1010
{{- end -}}
1111
{{- end -}}
1212
<div
1313
class="mb-6 image-container rounded"
14-
style="background-image: url('{{ $imageUrl }}'); height: 234px; width: 100%; border: 1px solid black; background-position: center; background-size: cover;"></div>
14+
style="background-image: url('{{ $imageUrl }}'); aspect-ratio: 2/1; width: 100%; border: 1px solid black; background-position: center; background-size: cover;"></div>
1515
{{ end }}
1616
<h4 class="mb-3">
1717
<a href="{{ .RelPermalink }}">

0 commit comments

Comments
 (0)