potential solution to screenshot

This commit is contained in:
stereobooster
2023-11-26 02:23:34 +01:00
parent 8cfe33965b
commit 11fd48f5d0
4 changed files with 30 additions and 15 deletions
+9 -1
View File
@@ -10,9 +10,17 @@
{{ $img = resources.Get $path }}
{{ end -}}
{{/* https://github.com/gohugoio/hugo/pull/10666/files */}}
{{- $params := $url.Query -}}
{{- $x2Param := $params.Get "x2" -}}
{{- $x2 := false -}}
{{- if eq $x2Param "true" -}}
{{- $x2 = true -}}
{{- end -}}
<figure>
{{- with $img -}}
{{ partial "pictureDefaults.html" (dict "img" . "alt" $altText "class" $class) }}
{{ partial "pictureDefaults.html" (dict "img" . "alt" $altText "class" $class "x2" $x2) }}
{{- else -}}
<img src="{{ .Destination | safeURL }}" alt="{{ $altText }}" class="{{ $class }}"/>
{{- end -}}