Skip to content

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

Description

@stoptime

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions