From e298aaecb8f4bd0c08f9adf992e6e95138be5c1d Mon Sep 17 00:00:00 2001
From: Alexander Bilz <mail@alexbilz.com>
Date: Mon, 24 Aug 2020 09:52:37 +0000
Subject: [PATCH] Fix syntax highlighting
---
layouts/partials/head.html | 7 +------
README.md | 5 +++++
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index 10c12d5..c0239cf 100644
--- a/README.md
+++ b/README.md
@@ -268,6 +268,11 @@
hugo gen chromastyles --style=monokailight > assets/css/syntax.css
```
If you get any errors, make sure the `assets/css/` directory exists within your sites root folder.
+Include the newly generated `syntax.css` like a standard custom css script:
+```
+[params]
+customCss = ["css/syntax.css"]
+```
## License
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 4039336..b0159f9 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -8,15 +8,10 @@
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}" crossorigin="anonymous" type="text/css">
{{- $css := "" -}}
{{- range .Site.Params.customCss -}}
- {{ $css := resources.Get . | minify | fingerprint }}
+ {{ $css := resources.Get . | fingerprint }}
<link rel="stylesheet" href="{{ $css.Permalink }}" integrity="{{ $css.Data.Integrity }}" crossorigin="anonymous" type="text/css">
{{- end -}}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
- <!-- Code highlighting -->
- {{- if .Site.Params.pygmentsUseClasses }}
- {{ $style := resources.Get "css/syntax.css" | resources.Fingerprint }}
- <link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}" crossorigin="anonymous" type="text/css">
- {{- end -}}
<!-- Favicons -->
<link rel="shortcut icon" href="{{ .Site.Params.favicon | absURL }}favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.Params.favicon | absURL }}apple-touch-icon.png">
--
Gitblit v1.10.0