diff options
author | Kasper Møller Andersen <kma_untrusted+KBrw3gdTXP@protonmail.com> | 2017-01-14 15:24:22 +0300 |
---|---|---|
committer | digitalcraftsman <digitalcraftsman@protonmail.com> | 2017-01-20 23:35:55 +0300 |
commit | f9338dd633ab4cb042253b0947e7a3922a91c1e1 (patch) | |
tree | af23512bcde72412d53d3ec47fe84a6e4c06ffc6 | |
parent | a18880582d11172cf98e474cc16b629536e3970e (diff) |
Run custom JS before starting highlight.js
highlight.js is configurable, and guaranteeing that your code runs before hljs gets started is nice I think.
Although the highlighting is likely to run after the custom JavaScript anyway, because `initHighlightingOnLoad` runs asynchronously, so I don't know if it will ever be a real problem.
-rw-r--r-- | layouts/partials/footer_js.html | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/layouts/partials/footer_js.html b/layouts/partials/footer_js.html index 3b9cdba..e3abb52 100644 --- a/layouts/partials/footer_js.html +++ b/layouts/partials/footer_js.html @@ -2,10 +2,11 @@ <script src="{{ "fancybox/jquery.fancybox.pack.js" | absURL }}"></script> <script src="{{ "js/script.js" | absURL }}"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/highlight.min.js"></script> -<script>hljs.initHighlightingOnLoad();</script> + {{ range .Site.Params.custom_js }} <script src="{{ . | absURL }}"></script> {{ end }} +<script>hljs.initHighlightingOnLoad();</script> {{ if .Site.Params.mathjax }} <script type="text/x-mathjax-config"> |