mirror of
https://github.com/alrayyes/wiki.git
synced 2025-04-29 22:04:14 +00:00
collapsible toc
This commit is contained in:
parent
917d5791ac
commit
6d5491fdcb
14 changed files with 176 additions and 114 deletions
quartz/plugins
|
@ -33,10 +33,6 @@ export function emitComponentResources(cfg: GlobalConfiguration, resources: Stat
|
|||
afterDOMLoaded: []
|
||||
}
|
||||
|
||||
if (cfg.enableSPA) {
|
||||
componentResources.afterDOMLoaded.push(spaRouterScript)
|
||||
}
|
||||
|
||||
for (const component of allComponents) {
|
||||
const { css, beforeDOMLoaded, afterDOMLoaded } = component
|
||||
if (css) {
|
||||
|
@ -50,6 +46,15 @@ export function emitComponentResources(cfg: GlobalConfiguration, resources: Stat
|
|||
}
|
||||
}
|
||||
|
||||
if (cfg.enableSPA) {
|
||||
componentResources.afterDOMLoaded.push(spaRouterScript)
|
||||
} else {
|
||||
componentResources.afterDOMLoaded.push(`
|
||||
const event = new CustomEvent("nav", { detail: { slug: document.body.dataset.slug } })
|
||||
document.dispatchEvent(event)`
|
||||
)
|
||||
}
|
||||
|
||||
emit({
|
||||
slug: "index",
|
||||
ext: ".css",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue