mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2025-03-13 03:06:15 +00:00
Make hljsTheme configurable, use dark theme for themeStyle=dark
This commit is contained in:
parent
a4803d7bb5
commit
594c8c1cc0
2 changed files with 9 additions and 2 deletions
|
@ -24,6 +24,7 @@ canonifyurls = true # Turns relative urls into a
|
||||||
description = "Website Description" # Max 160 characters show in search results
|
description = "Website Description" # Max 160 characters show in search results
|
||||||
faviconFile = "img/fav.ico"
|
faviconFile = "img/fav.ico"
|
||||||
highlightjs = true # Syntax highlighting
|
highlightjs = true # Syntax highlighting
|
||||||
|
hljsTheme = true # Select highlight.js theme: https://highlightjs.org/static/demo/
|
||||||
footerText = "" # Text to show in footer (overrides default text)
|
footerText = "" # Text to show in footer (overrides default text)
|
||||||
fadeIn = true # Turn on/off the fade-in effect
|
fadeIn = true # Turn on/off the fade-in effect
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,13 @@
|
||||||
|
|
||||||
<!-- CSS -->
|
<!-- CSS -->
|
||||||
{{ if .Site.Params.highlightjs }}
|
{{ if .Site.Params.highlightjs }}
|
||||||
|
{{ if .Site.Params.hljsTheme }}
|
||||||
|
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/{{ .Site.Params.hljsTheme }}.min.css">
|
||||||
|
{{ else if eq .Site.Params.themeStyle "light" }}
|
||||||
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/default.min.css">
|
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/default.min.css">
|
||||||
|
{{ else }}
|
||||||
|
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/tomorrow-night.min.css">
|
||||||
|
{{ end }}
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/highlight.min.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/highlight.min.js"></script>
|
||||||
<script>hljs.initHighlightingOnLoad();</script>
|
<script>hljs.initHighlightingOnLoad();</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in a new issue