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>
|
<path d="M12 6H0l6-6z" /></svg>
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
|
{{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>
|
||||||
|
{{end }}
|
||||||
<script>
|
<script>
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
if (localStorage.getItem("menu-scroll-position")) {
|
if (localStorage.getItem("menu-scroll-position")) {
|
||||||
|
|
Loading…
Reference in New Issue