-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Fix loading fonts when we exclude js"
as this breaks more stuff. This reverts commit 30540b0.
- Loading branch information
Showing
1 changed file
with
11 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,22 +29,21 @@ | |
(str (v/relative-root-prefix-from (v/map-index state current-path))))) | ||
|
||
(defn include-viewer-css [state] | ||
(list | ||
(hiccup/include-css "https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css") | ||
[:link {:rel "preconnect" :href "https://fonts.bunny.net"}] | ||
(hiccup/include-css "https://fonts.bunny.net/css?family=fira-mono:400,700%7Cfira-sans:400,400i,500,500i,700,700i%7Cfira-sans-condensed:700,700i%7Cpt-serif:400,400i,700,700i") | ||
(if-let [css-url (get-in state [:resource->url "/css/viewer.css"])] | ||
(hiccup/include-css (adjust-relative-path state css-url)) | ||
(list (hiccup/include-js "https://cdn.tailwindcss.com?plugins=typography") | ||
[:script (-> (slurp (io/resource "stylesheets/tailwind.config.js")) | ||
(str/replace #"^module.exports" "tailwind.config") | ||
(str/replace #"require\(.*\)" ""))] | ||
[:style {:type "text/tailwindcss"} (slurp (io/resource "stylesheets/viewer.css"))])))) | ||
(if-let [css-url (get-in state [:resource->url "/css/viewer.css"])] | ||
(hiccup/include-css (adjust-relative-path state css-url)) | ||
(list (hiccup/include-js "https://cdn.tailwindcss.com?plugins=typography") | ||
[:script (-> (slurp (io/resource "stylesheets/tailwind.config.js")) | ||
(str/replace #"^module.exports" "tailwind.config") | ||
(str/replace #"require\(.*\)" ""))] | ||
[:style {:type "text/tailwindcss"} (slurp (io/resource "stylesheets/viewer.css"))]))) | ||
|
||
(defn include-css+js [state] | ||
(list | ||
(include-viewer-css state) | ||
[:script {:type "module" :src (adjust-relative-path state (get-in state [:resource->url "/js/viewer.js"]))}])) | ||
[:script {:type "module" :src (adjust-relative-path state (get-in state [:resource->url "/js/viewer.js"]))}] | ||
(hiccup/include-css "https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css") | ||
[:link {:rel "preconnect" :href "https://fonts.bunny.net"}] | ||
(hiccup/include-css "https://fonts.bunny.net/css?family=fira-mono:400,700%7Cfira-sans:400,400i,500,500i,700,700i%7Cfira-sans-condensed:700,700i%7Cpt-serif:400,400i,700,700i"))) | ||
|
||
(defn escape-closing-script-tag [s] | ||
;; we must escape closing `</script>` tags, see | ||
|