From 537ba534612515c21b9699f8054aaa9f7b59c364 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sun, 2 Oct 2022 15:45:24 +0100 Subject: [PATCH] feat: support SVG as section background --- modules/wowchemy/layouts/partials/widget_page.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/wowchemy/layouts/partials/widget_page.html b/modules/wowchemy/layouts/partials/widget_page.html index 48f68095..56926dfb 100644 --- a/modules/wowchemy/layouts/partials/widget_page.html +++ b/modules/wowchemy/layouts/partials/widget_page.html @@ -59,7 +59,10 @@ {{/* See Hugo note on linking assets in styles: https://github.com/gohugoio/hugoThemes#common-permalink-issues */}} {{ $bg_img := resources.Get (printf "media/%s" $bg.image) }} {{ if $bg_img }} - {{ $bg_img = $bg_img.Fit "1920x1920 webp" }} + {{/* Exception for SVG as Hugo doesn't yet support image processing on SVG. */}} + {{ if ne $bg_img.MediaType.SubType "svg" }} + {{ $bg_img = $bg_img.Fit "1920x1920 webp" }} + {{ end }} {{ $style_bg = printf "%sbackground-image: url('%s');" $style_bg $bg_img.Permalink }} {{ else }} {{ errorf "Couldn't find `%s` in the `assets/media/` folder - please add it." $bg.image }}