mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2024-12-22 17:15:07 +01:00
highlightjs : include only on pages with mainSections
* this makes hljs not load on index, taxonomies, archive pages where code highlighting isn't used * improving page site load time
This commit is contained in:
parent
4ded4a5052
commit
ebb9eb4043
@ -12,9 +12,10 @@
|
||||
<path d="M12 6H0l6-6z" /></svg>
|
||||
</button>
|
||||
</a>
|
||||
|
||||
{{if in site.Params.mainSections .Type }}
|
||||
{{ $highlight := resources.Get "js/highlight.min.js" | minify | fingerprint}}
|
||||
<script src="{{ $highlight.Permalink }}" integrity="{{ $highlight.Data.Integrity }}"></script>
|
||||
{{end }}
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (localStorage.getItem("menu-scroll-position")) {
|
||||
|
Loading…
Reference in New Issue
Block a user