From 594c8c1cc0cbcadfc1789ffda9f2aa3eae9a59c9 Mon Sep 17 00:00:00 2001 From: Leonid Evdokimov Date: Sun, 28 Jan 2018 21:46:50 +0300 Subject: [PATCH] Make hljsTheme configurable, use dark theme for themeStyle=dark --- exampleSite/config.toml | 3 ++- layouts/partials/header.html | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index fffbd03..2a8d61d 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -24,6 +24,7 @@ canonifyurls = true # Turns relative urls into a description = "Website Description" # Max 160 characters show in search results faviconFile = "img/fav.ico" highlightjs = true # Syntax highlighting + hljsTheme = true # Select highlight.js theme: https://highlightjs.org/static/demo/ footerText = "" # Text to show in footer (overrides default text) fadeIn = true # Turn on/off the fade-in effect @@ -54,4 +55,4 @@ canonifyurls = true # Turns relative urls into a [[params.social]] url = "https://linkedin.com/" - icon = "linkedin" \ No newline at end of file + icon = "linkedin" 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 @@ {{ if .Site.Params.highlightjs }} +{{ if .Site.Params.hljsTheme }} + +{{ else if eq .Site.Params.themeStyle "light" }} +{{ else }} + +{{ end }} {{ end }} @@ -84,4 +90,4 @@ crossorigin="anonymous"> {{ end }} - \ No newline at end of file +