浏览代码

fix: console error when highlight disabled (#1455)

If "hightlight" was disabled, the following error appeared in the
console:

    Uncaught ReferenceError: code_highlighting is not defined
Ronny Chevalier 5 年之前
父节点
当前提交
c7b71e6c4b
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      layouts/partials/site_js.html

+ 2 - 0
layouts/partials/site_js.html

@@ -47,6 +47,8 @@
     {{/* Initialise code highlighting. */}}
     {{ if $.Scratch.Get "highlight_enabled" }}
     <script>const code_highlighting = true;</script>
+    {{ else }}
+    <script>const code_highlighting = false;</script>
     {{ end }}
 
     {{ if ne site.Params.search.engine 0 }}