From 931c901862a4da12b435c2ed6aa805b3999764d4 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sun, 2 Oct 2022 21:01:12 +0100 Subject: [PATCH] feat: load community block/widget styles From `assets/scss/blocks/.scss` --- .../wowchemy/layouts/partials/site_head.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/wowchemy/layouts/partials/site_head.html b/modules/wowchemy/layouts/partials/site_head.html index 8dbbf2ec..af6630d8 100644 --- a/modules/wowchemy/layouts/partials/site_head.html +++ b/modules/wowchemy/layouts/partials/site_head.html @@ -155,6 +155,23 @@ {{- end -}} + {{/* 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" }} + {{- if eq (getenv "WC_POST_CSS") "true" -}} + {{- $wc_block_styles = $wc_block_styles | postCSS -}} + {{- end -}} + {{- if hugo.IsProduction -}} + {{- $wc_block_styles = $wc_block_styles | minify | fingerprint "md5" -}} + {{- end -}} + {{- if eq (getenv "WC_POST_CSS") "true" -}} + {{/* PostProcess must be last action in the pipeline */}} + {{- $wc_block_styles = $wc_block_styles | resources.PostProcess -}} + {{- end -}} + + {{ end }} + {{/* Hugo Chroma Syntax Highlighter Initialization */}} {{/* TODO: optimize to only include the Chroma CSS themes when the page has code blocks. */}} {{ $hl_theme_light := site.Params.features.syntax_highlighter.theme_light | default "github-light" }}