fix(gallery): math error

This commit is contained in:
Jimmy Cai 2020-12-22 19:29:47 +01:00
parent 474d7911e8
commit 21c42d6d0e
No known key found for this signature in database
GPG Key ID: 3EA408E527F37B18

View File

@ -7,7 +7,7 @@
{{- with $alt -}} {{- with $alt -}}
{{- $caption = . | safeHTML -}} {{- $caption = . | safeHTML -}}
{{- end -}} {{- end -}}
<figure style="flex-grow: {{ $image.Width * 100 / $image.Height }}; flex-basis: {{ $image.Width * 240 / $image.Height }}"> <figure style="flex-grow: {{ div (mul $image.Width 100) $image.Height }}; flex-basis: {{ div (mul $image.Width 240) $image.Height }}px">
<a href="{{ $image.RelPermalink }}" data-size="{{ $image.Width }}x{{ $image.Height }}"> <a href="{{ $image.RelPermalink }}" data-size="{{ $image.Width }}x{{ $image.Height }}">
<img srcset="{{ $small.RelPermalink }} 480w, {{ $big.RelPermalink }} 1024w" <img srcset="{{ $small.RelPermalink }} 480w, {{ $big.RelPermalink }} 1024w"
src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" loading="lazy" src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" loading="lazy"