diff options
author | Regis Philibert <login@regisphilibert.com> | 2022-04-21 18:48:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-21 18:48:54 +0300 |
commit | 751ac93c1bcfcbe04f82a148382f2dbea255acb6 (patch) | |
tree | a47591b97be4cf04ca0b5cc1ee15f1fa7e9ec746 /layouts | |
parent | e91f77c5be8c196634cd1808336bdc6f72235e16 (diff) |
Upgrade "minVersion" of theme to 84 (#543)
* Upgrade "minVersion" of theme to 84
Check hugo.IsExtended before trying to process scss files
Fixes #541
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/func/style/GetMainCSS.html | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/layouts/partials/func/style/GetMainCSS.html b/layouts/partials/func/style/GetMainCSS.html index c4daa88..16ecd29 100644 --- a/layouts/partials/func/style/GetMainCSS.html +++ b/layouts/partials/func/style/GetMainCSS.html @@ -42,11 +42,20 @@ {{ end }} {{/* We look for any custom css files registered by the user under `site.params.custom_css and if found in the theme's -css asset directory we add to aforementioned slice */}} +css asset directory we (unless condition below) add to aforementioned slice */}} {{ with site.Params.custom_css }} {{ range . }} {{ with partialCached "func/style/GetResource" . . }} - {{ $assets_to_concat = $assets_to_concat | append . }} + {{ if eq .MediaType.SubType "x-scss" "x-sass" "scss" "sass" }} + {{ if hugo.IsExtended }} + {{/* as we cannot concatenate styles of different types, we sass/scss to be transformed to css beforehand */}} + {{ $assets_to_concat = $assets_to_concat | append (. | resources.ToCSS) }} + {{ else }} + {{ partial "func/warn" (printf "Processing of stylesheet %s of type %s has been skipped. You need Hugo Extended to process such files." .Name .MediaType.SubType) }} + {{ end }} + {{ else }} + {{ $assets_to_concat = $assets_to_concat | append . }} + {{ end }} {{ end }} {{ end }} {{ end }} |