mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-02-02 03:22:33 -06:00
Improve resizing for article thumbnails
Currently, the image is resized to be 600px, which will work for most images but caused issues for images which have very wide aspect ratios. This change updates the partials to use a Fill with an appropriate bounding box, rather than a simple resize.
This commit is contained in:
parent
5f1efb9946
commit
177b0fd567
2 changed files with 2 additions and 2 deletions
|
@ -13,7 +13,7 @@
|
||||||
{{- $featured := $images.GetMatch "*feature*" -}}
|
{{- $featured := $images.GetMatch "*feature*" -}}
|
||||||
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
|
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
|
||||||
{{- with $featured -}}
|
{{- with $featured -}}
|
||||||
{{ with .Resize "600x" }}
|
{{ with .Fill "600x600" }}
|
||||||
<div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
|
<div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
{{- $featured := $images.GetMatch "*feature*" -}}
|
{{- $featured := $images.GetMatch "*feature*" -}}
|
||||||
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
|
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
|
||||||
{{- with $featured -}}
|
{{- with $featured -}}
|
||||||
{{ with .Resize "600x" }}
|
{{ with .Fill "600x400" }}
|
||||||
<div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div>
|
<div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
|
|
Loading…
Reference in a new issue