diff --git a/modules/blox-tailwind/layouts/partials/functions/parse_block_v2.html b/modules/blox-tailwind/layouts/partials/functions/parse_block_v2.html index bf0bc9ab..4c871540 100644 --- a/modules/blox-tailwind/layouts/partials/functions/parse_block_v2.html +++ b/modules/blox-tailwind/layouts/partials/functions/parse_block_v2.html @@ -11,7 +11,12 @@ {{ end }} {{ $block_path := printf "blox/%s.html" $block_type }} {{ if not (templates.Exists (printf "partials/%s" $block_path)) }} - {{ errorf "%s uses a `%s` block but the `%s` block was not found at `layouts/partials/%s`" $block.File.Path $block_type $block_type $block_path }} + {{ $block_path_community := printf "blox/community/%s.html" $block_type }} + {{ if not (templates.Exists (printf "partials/%s" $block_path_community)) }} + {{ errorf "%s uses a `%s` blox but the `%s` blox was not found. Check the name of the blox and try again. For a custom or community blox, upload it first to `hugo-blox/blox/community/%s.html`. For an All Access blox, upload it first to `hugo-blox/blox/all-access/%s.html`" $page.File.Path $block_type $block_type $block_type $block_type }} + {{ else }} + {{ $block_path = $block_path_community }} + {{ end }} {{ end }} {{/* Mermaid block: Workaround to make Hugo's .Page.Store.Set cascade up to the parent of headless pages */}} diff --git a/modules/blox-tailwind/layouts/partials/site_head.html b/modules/blox-tailwind/layouts/partials/site_head.html index 65f9fc94..b920a7b0 100644 --- a/modules/blox-tailwind/layouts/partials/site_head.html +++ b/modules/blox-tailwind/layouts/partials/site_head.html @@ -69,6 +69,16 @@ {{ end }} + {{/* Load community blox styles */}} + {{ $hb_community_styles := resources.Match "dist/community/blox/**.css" }} + {{ with $hb_community_styles }} + {{ $hb_community_styles = $hb_community_styles | resources.Concat "css/community-hugo-blox.css" }} + {{- if hugo.IsProduction -}} + {{- $hb_community_styles = $hb_community_styles | minify | fingerprint "sha256" -}} + {{- end -}} + + {{ end }} + {{ if fileExists "assets/css/custom.css" }} {{ $styles := resources.Get "css/custom.css" | minify | fingerprint "sha256" }}