Merge pull request #12 from andy4thehuynh/ALH-add-highlight-js

Add highlight js for syntax highlighting
This commit is contained in:
nishanths
2016-09-03 08:42:58 -05:00
committed by GitHub
3 changed files with 14 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ Email = "you@example.space"
FaviconFile = "img/leaf.ico"
GATracker = "XYZ"
GitHub = "//github.com/you"
HighlightJS = true
Initials = "ad" # Displayed on single post page; DEPRECATED in v0.3.0.
Lang = "en"
LinkedIn = "//linkedin.com/in/you"

View File

@@ -11,3 +11,11 @@ try {
} catch(err) {}
</script>
{{ end }}
{{ if .Site.Params.HighlightJS }}
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/highlight.min.js"></script>
<script type="text/javascript">
hljs.initHighlightingOnLoad();
</script>
{{ end }}

View File

@@ -10,6 +10,11 @@
<!-- CSS -->
{{ if .Site.Params.HighlightJS }}
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/default.min.css">
{{ end }}
{{ if eq true .Site.Params.CacheBuster }}
<link rel="stylesheet" href="/css/reset.css">