From 1cc4d4ca11d92716208fc846f3e4fc3c8be5f980 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 25 Dec 2021 13:41:28 +0530 Subject: [PATCH] Set up 'includes' to load css by choice --- assets/css/{hljs => includes}/an-old-hope.min.css | 0 layouts/partials/head_styles.html | 15 +++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) rename assets/css/{hljs => includes}/an-old-hope.min.css (100%) diff --git a/assets/css/hljs/an-old-hope.min.css b/assets/css/includes/an-old-hope.min.css similarity index 100% rename from assets/css/hljs/an-old-hope.min.css rename to assets/css/includes/an-old-hope.min.css diff --git a/layouts/partials/head_styles.html b/layouts/partials/head_styles.html index 18b659f..e9affe6 100644 --- a/layouts/partials/head_styles.html +++ b/layouts/partials/head_styles.html @@ -4,12 +4,19 @@ {{- $media := (resources.Get "css/core/zmedia.css") }} {{- $common := (resources.Match "css/common/*.css") | resources.Concat "assets/css/common.css" }} -{{- /* include `an-old-hope` if hljs is on */}} -{{- $isHLJSdisabled := (.Site.Params.assets.disableHLJS | default false) }} -{{- $hljs := (cond ($isHLJSdisabled) (" " | resources.FromString "assets/css/hljs-blank.css") (resources.Get "css/hljs/an-old-hope.min.css")) }} +{{- /* includes */}} +{{- $includes := slice }} +{{- $includes = $includes | append (" " | resources.FromString "assets/css/includes-blank.css")}} + +{{- if not (.Site.Params.assets.disableHLJS) }} + {{- $hljs := (resources.Get "css/includes/an-old-hope.min.css") }} + {{- $includes = (append $hljs $includes) }} +{{- end }} + +{{- $includes_all := $includes | resources.Concat "assets/css/includes.css" }} {{- /* order is important */}} -{{- $core := (slice $theme_vars $reset $common $hljs $media) | resources.Concat "assets/css/core.css" }} +{{- $core := (slice $theme_vars $reset $common $includes_all $media) | resources.Concat "assets/css/core.css" }} {{- $extended := (resources.Match "css/extended/*.css") | resources.Concat "assets/css/extended.css" }} {{- /* bundle all required css */}}