Explorar o código

enhance: defer more scripts for publishing

Noticed when comparing with public/index.html
Gabriel Horner hai 4 meses
pai
achega
56e8a298b1
Modificáronse 1 ficheiros con 7 adicións e 6 borrados
  1. 7 6
      deps/publishing/src/logseq/publishing/html.cljs

+ 7 - 6
deps/publishing/src/logseq/publishing/html.cljs

@@ -126,14 +126,15 @@ necessary db filtering"
             [:script {:src "static/js/ui.js"}]
             [:script {:src "static/js/shared.js"}]
             [:script {:src "static/js/main.js"}]
-            [:script {:src "static/js/interact.min.js"}]
-            [:script {:src "static/js/highlight.min.js"}]
-            [:script {:src "static/js/katex.min.js"}]
+            ;; Deferring scripts above results in errors
+            [:script {:defer true :src "static/js/interact.min.js"}]
+            [:script {:defer true :src "static/js/highlight.min.js"}]
+            [:script {:defer true :src "static/js/katex.min.js"}]
             [:script {:defer true :type "module" :src "static/js/pdfjs/pdf.mjs"}]
             [:script {:defer true :type "module" :src "static/js/pdf_viewer3.mjs"}]
-            [:script {:src "static/js/html2canvas.min.js"}]
-            [:script {:src "static/js/code-editor.js"}]
-            [:script {:src "static/js/custom.js"}]])))))
+            [:script {:defer true :src "static/js/html2canvas.min.js"}]
+            [:script {:defer true :src "static/js/code-editor.js"}]
+            [:script {:defer true :src "static/js/custom.js"}]])))))
 
 (defn build-html
   "Given the graph's db, filters the db using the given options and returns the