From 97f796f224b42eaa2ca1b6cbe68ff2a889c79c11 Mon Sep 17 00:00:00 2001 From: Robin Stocker Date: Fri, 2 Dec 2016 11:21:00 +1100 Subject: [PATCH] Support additional languages for highlight.js highlight.min.js only includes 22 commonly used languages. E.g. Go and Rust are not part of that set. This change allows users to add the JS for additional languages via a config option. I've also updated the library to the newest version. --- exampleSite/config.toml | 1 + layouts/partials/footer_scripts.html | 5 ++++- layouts/partials/head_includes.html | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 0cf808c..61266bc 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -28,6 +28,7 @@ faviconfile = "img/leaf.ico" gatracker = "XYZ" github = "//github.com/you" highlightjs = true +# highlightjslanguages = ["go"] # additional languages not included in the "common" set initials = "ad" # Displayed on single post page; DEPRECATED in v0.3.0. lang = "en" linkedin = "//linkedin.com/in/you" diff --git a/layouts/partials/footer_scripts.html b/layouts/partials/footer_scripts.html index 3d5b926..946b568 100644 --- a/layouts/partials/footer_scripts.html +++ b/layouts/partials/footer_scripts.html @@ -13,7 +13,10 @@ try { {{ end }} {{ if .Site.Params.highlightjs }} - + + {{ range .Site.Params.highlightjslanguages }} + + {{ end }}