Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/chipzoller/hugo-clarity.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/figure.html')
-rw-r--r--layouts/partials/figure.html7
1 files changed, 4 insertions, 3 deletions
diff --git a/layouts/partials/figure.html b/layouts/partials/figure.html
index 3d797e2..8b38535 100644
--- a/layouts/partials/figure.html
+++ b/layouts/partials/figure.html
@@ -17,6 +17,10 @@
{{- $classes := .classes -}}
{{- $bundle := .bundle -}}
+{{- if eq $bundle true -}}
+ {{ $file = path.Join "/" $dir $file }}
+{{- end -}}
+
<figure>
<picture>
@@ -26,9 +30,6 @@
{{ $ext := slice "avif" "webp" "jxl" }}
{{- range $ext -}}
{{ $path := printf "%s" . | printf "%s%s" "." | printf "%s%s" $name | printf "%s" }}
- {{- if eq $bundle true -}}
- {{ $path = path.Join "/" $dir $path }}
- {{- end -}}
{{- if fileExists $path -}}
<source srcset="{{ $path }}" type="image/{{ . }}">
{{- end -}}