footer: mv hljs initialiser with resource

* hinders linter
This commit is contained in:
Aditya Telange 2020-09-23 12:33:19 +05:30
parent 05035121ff
commit 2cb5c9dad5
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77

View File

@ -14,6 +14,7 @@
{{if in site.Params.mainSections .Type }} {{if in site.Params.mainSections .Type }}
{{ $highlight := resources.Get "js/highlight.min.js" | minify | fingerprint}} {{ $highlight := resources.Get "js/highlight.min.js" | minify | fingerprint}}
<script src="{{ $highlight.Permalink }}" integrity="{{ $highlight.Data.Integrity }}"></script> <script src="{{ $highlight.Permalink }}" integrity="{{ $highlight.Data.Integrity }}"></script>
<script>hljs.initHighlightingOnLoad();</script>
{{end }} {{end }}
<script> <script>
window.onload = function () { window.onload = function () {
@ -21,9 +22,6 @@
document.getElementById('menu').scrollLeft = localStorage.getItem("menu-scroll-position"); document.getElementById('menu').scrollLeft = localStorage.getItem("menu-scroll-position");
} }
} }
{{if in site.Params.mainSections .Type }}
hljs.initHighlightingOnLoad();
{{end }}
document.querySelectorAll('a[href^="#"]').forEach(anchor => { document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener("click", function (e) { anchor.addEventListener("click", function (e) {
e.preventDefault(); e.preventDefault();