mirror of
https://github.com/PrivSec-dev/privsec.dev
synced 2025-02-20 18:31:35 -05:00
load highlightingjs without inline
This commit is contained in:
parent
c672ce9026
commit
a889886d18
@ -106,3 +106,7 @@ initializeMenu();
|
|||||||
if (params.scrollToTop) scrollToTop();
|
if (params.scrollToTop) scrollToTop();
|
||||||
if (params.themeToggle) themeToggle();
|
if (params.themeToggle) themeToggle();
|
||||||
if (params.showCodeCopyButtons) showCodeCopyButtons();
|
if (params.showCodeCopyButtons) showCodeCopyButtons();
|
||||||
|
|
||||||
|
if ('hljs' in window) {
|
||||||
|
hljs.initHighlightingOnLoad();
|
||||||
|
}
|
@ -18,11 +18,10 @@
|
|||||||
{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not $isHLJSdisabled)) }}
|
{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not $isHLJSdisabled)) }}
|
||||||
{{- if not site.Params.assets.disableFingerprinting }}
|
{{- if not site.Params.assets.disableFingerprinting }}
|
||||||
{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | fingerprint }}
|
{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | fingerprint }}
|
||||||
<script defer crossorigin="anonymous" src="{{ $highlight.RelPermalink }}" integrity="{{ $highlight.Data.Integrity }}"
|
<script defer crossorigin="anonymous" src="{{ $highlight.RelPermalink }}" integrity="{{ $highlight.Data.Integrity }}"></script>
|
||||||
onload="hljs.initHighlightingOnLoad();"></script>
|
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" }}
|
{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" }}
|
||||||
<script defer crossorigin="anonymous" src="{{ $highlight.RelPermalink }}" onload="hljs.initHighlightingOnLoad();"></script>
|
<script defer crossorigin="anonymous" src="{{ $highlight.RelPermalink }}"></script>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user