Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonid Evdokimov <leon@darkk.net.ru>2018-01-28 21:46:50 +0300
committerLeonid Evdokimov <leon@darkk.net.ru>2018-01-28 21:46:50 +0300
commit594c8c1cc0cbcadfc1789ffda9f2aa3eae9a59c9 (patch)
treee7a9755779b8c3ac6e237e778a750706d43f0f99 /layouts/partials/header.html
parenta4803d7bb5257c82adb2b80b6033b6b175d78fad (diff)
Make hljsTheme configurable, use dark theme for themeStyle=dark
Diffstat (limited to 'layouts/partials/header.html')
-rw-r--r--layouts/partials/header.html8
1 files changed, 7 insertions, 1 deletions
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 89ca738..c775331 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -35,7 +35,13 @@
<!-- CSS -->
{{ 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">
+{{ 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>hljs.initHighlightingOnLoad();</script>
{{ end }}
@@ -84,4 +90,4 @@ crossorigin="anonymous"></script>
<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
{{ end }}
-</head> \ No newline at end of file
+</head>