The Trans Directory
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: mermaid script load order

+34 -29
+2 -2
docs/index.md
··· 31 31 32 32 ## 🔧 Features 33 33 34 - - [[Obsidian compatibility]], [[full-text search]], [[graph view]], note transclusion, [[wikilinks]], [[backlinks]], [[features/Latex|Latex]], [[syntax highlighting]], [[popover previews]], [[Docker Support]], [[i18n|internationalization]], [[comments]] and [many more](./features) right out of the box 34 + - [[Obsidian compatibility]], [[full-text search]], [[graph view]], note transclusion, [[wikilinks]], [[backlinks]], [[features/Latex|Latex]], [[syntax highlighting]], [[popover previews]], [[Docker Support]], [[i18n|internationalization]], [[comments]] and [many more](./features/) right out of the box 35 35 - Hot-reload for both configuration and content 36 36 - Simple JSX layouts and [[creating components|page components]] 37 37 - [[SPA Routing|Ridiculously fast page loads]] and tiny bundle sizes 38 38 - Fully-customizable parsing, filtering, and page generation through [[making plugins|plugins]] 39 39 40 - For a comprehensive list of features, visit the [features page](/features). You can read more about the _why_ behind these features on the [[philosophy]] page and a technical overview on the [[architecture]] page. 40 + For a comprehensive list of features, visit the [features page](./features/). You can read more about the _why_ behind these features on the [[philosophy]] page and a technical overview on the [[architecture]] page. 41 41 42 42 ### 🚧 Troubleshooting + Updating 43 43
+8 -8
quartz/components/renderPage.tsx
··· 58 58 additionalHead: staticResources.additionalHead, 59 59 } 60 60 61 + resources.js.push({ 62 + src: joinSegments(baseDir, "postscript.js"), 63 + loadTime: "afterDOMReady", 64 + moduleType: "module", 65 + contentType: "external", 66 + }) 67 + 68 + // dynamic afterDOMReady must come after postscript.js 61 69 if (fileData.hasMermaidDiagram) { 62 70 resources.js.push({ 63 71 script: mermaidScript, ··· 67 75 }) 68 76 resources.css.push({ content: mermaidStyle, inline: true }) 69 77 } 70 - 71 - // NOTE: we have to put this last to make sure spa.inline.ts is the last item. 72 - resources.js.push({ 73 - src: joinSegments(baseDir, "postscript.js"), 74 - loadTime: "afterDOMReady", 75 - moduleType: "module", 76 - contentType: "external", 77 - }) 78 78 79 79 return resources 80 80 }
+6 -8
quartz/components/scripts/callout.inline.ts
··· 28 28 ) as HTMLCollectionOf<HTMLElement> 29 29 for (const div of collapsible) { 30 30 const title = div.firstElementChild 31 + if (!title) continue 31 32 32 - if (title) { 33 - title.addEventListener("click", toggleCallout) 34 - window.addCleanup(() => title.removeEventListener("click", toggleCallout)) 33 + title.addEventListener("click", toggleCallout) 34 + window.addCleanup(() => title.removeEventListener("click", toggleCallout)) 35 35 36 - const collapsed = div.classList.contains("is-collapsed") 37 - const height = collapsed ? title.scrollHeight : div.scrollHeight 38 - div.style.maxHeight = height + "px" 39 - } 36 + const collapsed = div.classList.contains("is-collapsed") 37 + const height = collapsed ? title.scrollHeight : div.scrollHeight 38 + div.style.maxHeight = height + "px" 40 39 } 41 40 } 42 41 43 42 document.addEventListener("nav", setupCallout) 44 - window.addEventListener("resize", setupCallout)
+18 -11
quartz/components/scripts/spa.inline.ts
··· 56 56 }, 100) 57 57 } 58 58 59 + let isNavigating = false 59 60 let p: DOMParser 60 - async function navigate(url: URL, isBack: boolean = false) { 61 + async function _navigate(url: URL, isBack: boolean = false) { 62 + isNavigating = true 61 63 startLoading() 62 64 p = p || new DOMParser() 63 65 const contents = await fetchCanonical(url) ··· 128 130 delete announcer.dataset.persist 129 131 } 130 132 133 + async function navigate(url: URL, isBack: boolean = false) { 134 + if (isNavigating) return 135 + isNavigating = true 136 + try { 137 + await _navigate(url, isBack) 138 + } catch (e) { 139 + console.error(e) 140 + window.location.assign(url) 141 + } finally { 142 + isNavigating = false 143 + } 144 + } 145 + 131 146 window.spaNavigate = navigate 132 147 133 148 function createRouter() { ··· 145 160 return 146 161 } 147 162 148 - try { 149 - navigate(url, false) 150 - } catch (e) { 151 - window.location.assign(url) 152 - } 163 + navigate(url, false) 153 164 }) 154 165 155 166 window.addEventListener("popstate", (event) => { 156 167 const { url } = getOpts(event) ?? {} 157 168 if (window.location.hash && window.location.pathname === url?.pathname) return 158 - try { 159 - navigate(new URL(window.location.toString()), true) 160 - } catch (e) { 161 - window.location.reload() 162 - } 169 + navigate(new URL(window.location.toString()), true) 163 170 return 164 171 }) 165 172 }