spf13 / hyde

Port of Mdo's excellent theme to Hugo
Other
556 stars 579 forks source link

console error: "hljs is not defined" even when highlightjs is not set #76

Open stoptime opened 4 years ago

stoptime commented 4 years ago

in layouts/partials/highlight-js.html - I fixed by:

diff --git a/layouts/partials/highlight-js.html b/layouts/partials/highlight-js.html
index 87c347d..917399d 100644
--- a/layouts/partials/highlight-js.html
+++ b/layouts/partials/highlight-js.html
@@ -7,12 +7,12 @@
                 <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/languages/{{.}}.min.js"></script>
             {{ end }}
         {{ end }}
-    {{ end }}
     <script type="text/javascript">
         {{ with $.Scratch.Get "hl_languages" }}
         hljs.configure({languages: [{{(delimit . ", ")}}]});
         {{ end }}
         hljs.initHighlightingOnLoad();
     </script>
+    {{ end }}
     {{ $.Scratch.Delete "hl_languages" }}
 {{ end }}
(END)