From 0c0c6847e56e137664c1633e7f3e1d6fdc7f067a Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sat, 27 Mar 2021 21:41:47 +0530 Subject: [PATCH] Don't include `an-old-hope` when hljs is disabled - reduces 0.6 kb resources --- layouts/partials/head.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 4e4099f8..8914fda9 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -30,9 +30,12 @@ {{- $theme_vars := (resources.Get "css/core/theme-vars.css") }} {{- $reset := (resources.Get "css/core/reset.css") }} {{- $media := (resources.Get "css/core/zmedia.css") }} -{{- $hljs := (resources.Get "css/hljs/an-old-hope.min.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 .Params.disableHLJS ) | default false }} +{{- $hljs := (cond ($isHLJSdisabled) (" " | resources.FromString "assets/css/hljs-blank.css") (resources.Get "css/hljs/an-old-hope.min.css")) }} + {{- /* order is important */}} {{- $core := (slice $theme_vars $reset $common $hljs $media) | resources.Concat "assets/css/core.css" }} {{- $extended := (resources.Match "css/extended/*.css") | resources.Concat "assets/css/extended.css" }}