From 56e8a298b1039d807fc81f894e2a2ebbf6f10202 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 6 Jun 2025 13:45:33 -0400 Subject: [PATCH] enhance: defer more scripts for publishing Noticed when comparing with public/index.html --- deps/publishing/src/logseq/publishing/html.cljs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/deps/publishing/src/logseq/publishing/html.cljs b/deps/publishing/src/logseq/publishing/html.cljs index 2f1a1fb0ad..ff4e4e8036 100644 --- a/deps/publishing/src/logseq/publishing/html.cljs +++ b/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