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