Don't include `an-old-hope` when hljs is disabled

- reduces 0.6 kb resources
This commit is contained in:
Aditya Telange 2021-03-27 21:41:47 +05:30
parent 2fea5a1062
commit 0c0c6847e5
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77
1 changed files with 4 additions and 1 deletions

View File

@ -30,9 +30,12 @@
{{- $theme_vars := (resources.Get "css/core/theme-vars.css") }} {{- $theme_vars := (resources.Get "css/core/theme-vars.css") }}
{{- $reset := (resources.Get "css/core/reset.css") }} {{- $reset := (resources.Get "css/core/reset.css") }}
{{- $media := (resources.Get "css/core/zmedia.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" }} {{- $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 */}} {{- /* order is important */}}
{{- $core := (slice $theme_vars $reset $common $hljs $media) | resources.Concat "assets/css/core.css" }} {{- $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" }} {{- $extended := (resources.Match "css/extended/*.css") | resources.Concat "assets/css/extended.css" }}