Add syntax highlight config to site config file

Generate a Monokai and MonokaiLight CSS file for highlighting
Include the CSS file in <head>
This commit is contained in:
Eryn Wells 2022-08-18 20:15:33 -07:00
parent b8050c6993
commit 4c1baa2b6d
3 changed files with 182 additions and 4 deletions

View file

@ -25,10 +25,8 @@
{{ if in (.Site.BaseURL | string) "localhost" }}
<link rel="preload stylesheet" as="style" href="/styles/development.css">
{{ end }}
{{ if and .IsPage (not site.Params.disableHLJS) }}
<link rel="preload stylesheet" as="style" href="{{ `styles/an-old-hope.min.css` | absURL }}">
<script defer src="{{ `scripts/highlight.min.js` | absURL }}" onload="hljs.initHighlightingOnLoad();"></script>
{{ if .IsPage }}
<link rel="preload stylesheet" as="style" href="{{ `styles/monokai.css` | absURL }}">
{{ end }}
{{ range $.Scratch.Get "social-list" }}