mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-20 00:14:48 +00:00
fix: handle SVG images in responsive image processing
SVG resources don't support .Width, .Height, or .Process in Hugo, causing crashes in process_responsive_image.html and all callers that pass SVGs without guards. Add SVG checks to process_responsive_image.html, preact-wrapper.html, resume-biography, resume-biography-3, authors/term, and page_author_card. Fixes #3305
This commit is contained in:
1 parent
71f472d381
commit
2c3a2491f1
7 files changed
+65
-37
No files matched your search
@@ -138,8 +138,7 @@ Returns: Map with processed images and srcset string
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
{{- else -}}
|
||||
{{/* Handle unsupported formats (SVG, GIF) */}}
|
||||
{{- $srcset_parts = $srcset_parts | append (printf "%s %dw" $image.RelPermalink $image.Width) -}}
|
||||
{{/* Handle unsupported formats (SVG, GIF) - skip srcset as width/height are unavailable for SVGs */}}
|
||||
{{- $fallback_image = $image -}}
|
||||
{{- $processed_images = $processed_images | append $image -}}
|
||||
{{- end -}}
|
||||
|
||||
Reference in new issue
Block a user