fix: load community block/widget styles

From `assets/scss/blocks/<unique-block-name>.scss`
This commit is contained in:
George Cushen committed 2022-10-04 19:25:30 +01:00
1 parent 931c901862
commit 3349024c90
3 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -13,9 +13,9 @@
<div class="container">
{{/* Show the About widget if an account exists for this user. */}}
{{ if .File }}
{{ $widget := "widgets/about.html" }}
{{ $widget := "blocks/about.html" }}
{{ $username := (path.Base .File.Dir) }}{{/* Alternatively, use `index .Params.authors 0` */}}
{{ $params := dict "root" $ "page" . "author" $username }}
{{ $params := dict "wcPage" $ "wcBlock" . "author" $username }}
{{ partial $widget $params }}
{{end}}
@@ -101,7 +101,7 @@
{{ $widget_class := printf "wg-%s" (replace (replace $block_type "." "-") "_" "-") }}
{{ $widget_config_file := printf "widgets/%s-config.html" $block_type }}
{{ $widget_config_file := printf "blocks/%s-config.html" $block_type }}
{{ if templates.Exists $widget_config_file }}
{{ $cfg := partial $widget_config_file $widget_args }}
{{ $use_container = $cfg.use_container }}
@@ -158,7 +158,7 @@
{{/* Load WC community block styles */}}
{{ $wc_block_styles := resources.Match "scss/blocks/**.scss" }}
{{ with $wc_block_styles }}
{{ $wc_block_styles = $wc_block_styles | resources.Concat "css/wowchemy-blocks.css" }}
{{ $wc_block_styles = $wc_block_styles | resources.Concat "css/wowchemy-blocks.scss" | resources.ToCSS }}
{{- if eq (getenv "WC_POST_CSS") "true" -}}
{{- $wc_block_styles = $wc_block_styles | postCSS -}}
{{- end -}}