diff --git a/assets/js/papermod.js b/assets/js/papermod.js
index 641867c..c90a8e4 100644
--- a/assets/js/papermod.js
+++ b/assets/js/papermod.js
@@ -105,4 +105,8 @@ function showCodeCopyButtons() {
initializeMenu();
if (params.scrollToTop) scrollToTop();
if (params.themeToggle) themeToggle();
-if (params.showCodeCopyButtons) showCodeCopyButtons();
\ No newline at end of file
+if (params.showCodeCopyButtons) showCodeCopyButtons();
+
+if ('hljs' in window) {
+ hljs.initHighlightingOnLoad();
+}
\ No newline at end of file
diff --git a/layouts/partials/script.html b/layouts/partials/script.html
index bda3a1d..33becc1 100644
--- a/layouts/partials/script.html
+++ b/layouts/partials/script.html
@@ -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 }}
-
+
{{- else }}
{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" }}
-
+
{{- end }}
{{- end }}