refactor(gallery): rewrite gallery (#79)

closes https://github.com/CaiJimmy/hugo-theme-stack/issues/70
This commit is contained in:
Jimmy Cai
2020-12-22 19:35:37 +01:00
committed by GitHub
parent 54571f036b
commit 31c42bcfe7
5 changed files with 109 additions and 301 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
{{- with $alt -}}
{{- $caption = . | safeHTML -}}
{{- end -}}
<figure>
<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 }}">
<img srcset="{{ $small.RelPermalink }} 480w, {{ $big.RelPermalink }} 1024w"
src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" loading="lazy"