mirror of
https://github.com/Noettore/cocoa-eh-hugo-theme.git
synced 2025-10-15 19:56:41 +02:00

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.
25 lines
884 B
HTML
25 lines
884 B
HTML
<!-- Google Analytics -->
|
|
{{ if .Site.Params.gatracker }}
|
|
<script type="text/javascript">
|
|
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
|
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
|
</script>
|
|
<script type="text/javascript">
|
|
try {
|
|
var pageTracker = _gat._getTracker("{{ .Site.Params.gatracker }}");
|
|
pageTracker._trackPageview();
|
|
} catch(err) {}
|
|
</script>
|
|
{{ end }}
|
|
|
|
{{ if .Site.Params.highlightjs }}
|
|
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/highlight.min.js"></script>
|
|
{{ range .Site.Params.highlightjslanguages }}
|
|
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/languages/{{.}}.min.js"></script>
|
|
{{ end }}
|
|
|
|
<script type="text/javascript">
|
|
hljs.initHighlightingOnLoad();
|
|
</script>
|
|
{{ end }}
|