summaryrefslogtreecommitdiffstats
path: root/layouts/partials
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2022-05-08 13:50:57 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2022-05-08 13:50:57 +0200
commitf51d4ec6182d93283c794501b02df43a7f07011b (patch)
tree8a843cc827ec070ff19f1533a0ec8ae0b28c6125 /layouts/partials
parente21a3141ca659bf6140dc1350b4552b6ddddf357 (diff)
downloadgohugo-theme-ed-f51d4ec6182d93283c794501b02df43a7f07011b.tar.gz
Use Chroma instead of highlight.js
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/head.html1
-rw-r--r--layouts/partials/hljs.html15
-rw-r--r--layouts/partials/styles.html7
3 files changed, 2 insertions, 21 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index f11c57d..d030521 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -17,7 +17,6 @@
{{ hugo.Generator }}
{{- partial "styles.html" . }}
- {{- partial "hljs.html" . }}
{{- partial "custom-scripts.html" . }}
{{- /* Favicons */}}
diff --git a/layouts/partials/hljs.html b/layouts/partials/hljs.html
deleted file mode 100644
index db01de9..0000000
--- a/layouts/partials/hljs.html
+++ /dev/null
@@ -1,15 +0,0 @@
-{{- /* Highlight.js */}}
-{{- $isHLJSdisabled := (site.Params.assets.disable_highlight_js | default .Params.disable_highlight_js ) }}
-{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not $isHLJSdisabled)) }}
- {{- if not site.Params.assets.disable_fingerprinting }}
- {{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify | fingerprint }}
- <script crossorigin="anonymous" src="{{ $highlight.RelPermalink }}" integrity="{{ $highlight.Data.Integrity }}"></script>
- {{- else }}
- {{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify }}
- <script crossorigin="anonymous" src="{{ $highlight.RelPermalink }}"></script>
- {{- end }}
-{{- end }}
- <script>
- hljs.highlightAll();
- hljs.configure({ ignoreUnescapedHTML: true });
- </script>
diff --git a/layouts/partials/styles.html b/layouts/partials/styles.html
index af7c709..32513eb 100644
--- a/layouts/partials/styles.html
+++ b/layouts/partials/styles.html
@@ -1,12 +1,9 @@
{{- /* Styles */}}
{{- $theme := resources.Get "sass/style.scss" | resources.ToCSS }}
-{{- /* include hljs' css if hljs is on */}}
-{{- $isHLJSdisabled := (site.Params.assets.disable_highlight_js | default false) }}
-{{- $hljs := (cond ($isHLJSdisabled) (" " | resources.FromString "assets/css/hljs-blank.css") (resources.Get "css/hljs/hljs-default.min.css")) }}
-
{{- /* order is important */}}
-{{- $core := (slice $theme $hljs) | resources.Concat "assets/css/core.css" }}
+{{- /* to ass more styles use the following format: slice $theme $style1 $style2 $style3 ... */}}
+{{- $core := (slice $theme) | resources.Concat "assets/css/core.css" }}
{{- $extended := (resources.Match "css/extended/*.css") | resources.Concat "assets/css/extended.css" }}
{{- /* bundle all required css */}}