Compare commits
5 Commits
17947be625
...
ec315ea1b5
Author | SHA1 | Date | |
---|---|---|---|
ec315ea1b5
|
|||
507708b242
|
|||
f1ca91c9bc
|
|||
4c46e118c1
|
|||
f207cf7472
|
@@ -25,28 +25,30 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- with $image -}}
|
{{- with $image -}}
|
||||||
{{ $full := . | images.Filter (images.Process "webp q90") }}
|
{{ $original := . }}
|
||||||
|
|
||||||
{{ $thumb := . }}
|
{{ $full := $original | images.Filter (images.Process "webp q90") }}
|
||||||
{{- if gt .Width 2000 -}}
|
|
||||||
{{- $thumb = . | images.Filter (images.Process "resize 2000x webp q75") -}}
|
{{ $thumb := $original }}
|
||||||
|
{{- if gt $original.Width 2000 -}}
|
||||||
|
{{- $thumb = $original | images.Filter (images.Process "resize 2000x webp q75") -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $thumb = . | images.Filter (images.Process "webp q75") -}}
|
{{- $thumb = $original | images.Filter (images.Process "webp q75") -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|
||||||
<figure class="captioned-image lightbox">
|
<figure class="captioned-image lightbox">
|
||||||
<a
|
<a
|
||||||
href="{{- .RelPermalink -}}"
|
href="{{- $original.RelPermalink -}}"
|
||||||
data-pswp-src="{{- .RelPermalink -}}"
|
data-pswp-src="{{- $full.RelPermalink -}}"
|
||||||
data-pswp-width="{{- .Width -}}"
|
data-pswp-width="{{- $full.Width -}}"
|
||||||
data-pswp-height="{{- .Height -}}"
|
data-pswp-height="{{- $full.Height -}}"
|
||||||
class="pswp-image"
|
class="pswp-image"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src="{{- $thumb.RelPermalink -}}"
|
src="{{- $thumb.RelPermalink -}}"
|
||||||
width="{{- .Width -}}"
|
width="{{- $thumb.Width -}}"
|
||||||
height="{{- .Height -}}"
|
height="{{- $thumb.Height -}}"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
{{ with $title }}title="{{- . -}}"{{ end }}
|
{{ with $title }}title="{{- . -}}"{{ end }}
|
||||||
{{ with $alt }}alt="{{- . -}}"{{ end }}
|
{{ with $alt }}alt="{{- . -}}"{{ end }}
|
||||||
|
Reference in New Issue
Block a user