mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-25 21:16:21 +00:00
fix mermaid initialization
This commit is contained in:
parent
21a7ec2307
commit
9e76b257d4
3 changed files with 9 additions and 3 deletions
|
@ -121,7 +121,7 @@ async function popContentFolder(contentFolder) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function gitPull(origin, branch) {
|
function gitPull(origin, branch) {
|
||||||
const flags = ["-s", "recursive", "-X", "ours"]
|
const flags = ["-s", "recursive", "-X", "ours", "--no-edit"]
|
||||||
spawnSync("git", ["pull", ...flags, origin, branch], { stdio: "inherit" })
|
spawnSync("git", ["pull", ...flags, origin, branch], { stdio: "inherit" })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -334,7 +334,6 @@ See the [documentation](https://quartz.jzhao.xyz) for how to get started.
|
||||||
sourcefile,
|
sourcefile,
|
||||||
},
|
},
|
||||||
write: false,
|
write: false,
|
||||||
minify: true,
|
|
||||||
bundle: true,
|
bundle: true,
|
||||||
platform: "browser",
|
platform: "browser",
|
||||||
format: "esm",
|
format: "esm",
|
||||||
|
|
|
@ -414,7 +414,13 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
|
||||||
js.push({
|
js.push({
|
||||||
script: `
|
script: `
|
||||||
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
|
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
|
||||||
mermaid.initialize({ startOnLoad: true });
|
document.addEventListener('nav', async () => {
|
||||||
|
const darkMode = document.documentElement.getAttribute('saved-theme') === 'dark'
|
||||||
|
mermaid.initialize({
|
||||||
|
securityLevel: 'loose',
|
||||||
|
theme: darkMode ? 'dark' : 'default'
|
||||||
|
});
|
||||||
|
});
|
||||||
`,
|
`,
|
||||||
loadTime: "afterDOMReady",
|
loadTime: "afterDOMReady",
|
||||||
moduleType: "module",
|
moduleType: "module",
|
||||||
|
|
|
@ -310,6 +310,7 @@ pre {
|
||||||
|
|
||||||
&:has(> code.mermaid) {
|
&:has(> code.mermaid) {
|
||||||
border: none;
|
border: none;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
& > code {
|
& > code {
|
||||||
|
|
Loading…
Reference in a new issue