1
0
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:
Wonderfall 2022-07-21 21:44:53 +02:00
parent c672ce9026
commit a889886d18
2 changed files with 7 additions and 4 deletions

View File

@ -105,4 +105,8 @@ function showCodeCopyButtons() {
initializeMenu();
if (params.scrollToTop) scrollToTop();
if (params.themeToggle) themeToggle();
if (params.showCodeCopyButtons) showCodeCopyButtons();
if (params.showCodeCopyButtons) showCodeCopyButtons();
if ('hljs' in window) {
hljs.initHighlightingOnLoad();
}

View File

@ -18,11 +18,10 @@
{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not $isHLJSdisabled)) }}
{{- if not site.Params.assets.disableFingerprinting }}
{{- $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 }}"
onload="hljs.initHighlightingOnLoad();"></script>
<script defer crossorigin="anonymous" src="{{ $highlight.RelPermalink }}" integrity="{{ $highlight.Data.Integrity }}"></script>
{{- else }}
{{- $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 }}