mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-21 21:45:42 -05:00
fix: set relativePath on virtual pages to prevent explorer crash
This commit is contained in:
parent
0edec5de2c
commit
dd5b794c9b
@ -2,7 +2,7 @@ import { QuartzEmitterPlugin, QuartzPageTypePluginInstance } from "../types"
|
|||||||
import { QuartzComponent, QuartzComponentProps } from "../../components/types"
|
import { QuartzComponent, QuartzComponentProps } from "../../components/types"
|
||||||
import { pageResources, renderPage } from "../../components/renderPage"
|
import { pageResources, renderPage } from "../../components/renderPage"
|
||||||
import { FullPageLayout } from "../../cfg"
|
import { FullPageLayout } from "../../cfg"
|
||||||
import { FullSlug, pathToRoot } from "../../util/path"
|
import { FilePath, FullSlug, pathToRoot } from "../../util/path"
|
||||||
import { ProcessedContent, defaultProcessedContent } from "../vfile"
|
import { ProcessedContent, defaultProcessedContent } from "../vfile"
|
||||||
import { write } from "../emitters/helpers"
|
import { write } from "../emitters/helpers"
|
||||||
import { BuildCtx, trieFromAllFiles } from "../../util/ctx"
|
import { BuildCtx, trieFromAllFiles } from "../../util/ctx"
|
||||||
@ -128,8 +128,10 @@ export const PageTypeDispatcher: QuartzEmitterPlugin<Partial<DispatcherOptions>>
|
|||||||
|
|
||||||
for (const vp of virtualPages) {
|
for (const vp of virtualPages) {
|
||||||
const vpSlug = vp.slug as FullSlug
|
const vpSlug = vp.slug as FullSlug
|
||||||
|
const vpRelativePath = (vpSlug + ".md") as FilePath
|
||||||
const [tree, vfile] = defaultProcessedContent({
|
const [tree, vfile] = defaultProcessedContent({
|
||||||
slug: vpSlug,
|
slug: vpSlug,
|
||||||
|
relativePath: vpRelativePath,
|
||||||
frontmatter: { title: vp.title, tags: [] },
|
frontmatter: { title: vp.title, tags: [] },
|
||||||
...vp.data,
|
...vp.data,
|
||||||
})
|
})
|
||||||
@ -179,8 +181,10 @@ export const PageTypeDispatcher: QuartzEmitterPlugin<Partial<DispatcherOptions>>
|
|||||||
|
|
||||||
for (const vp of virtualPages) {
|
for (const vp of virtualPages) {
|
||||||
const vpSlug = vp.slug as FullSlug
|
const vpSlug = vp.slug as FullSlug
|
||||||
|
const vpRelativePath = (vpSlug + ".md") as FilePath
|
||||||
const [tree, vfile] = defaultProcessedContent({
|
const [tree, vfile] = defaultProcessedContent({
|
||||||
slug: vpSlug,
|
slug: vpSlug,
|
||||||
|
relativePath: vpRelativePath,
|
||||||
frontmatter: { title: vp.title, tags: [] },
|
frontmatter: { title: vp.title, tags: [] },
|
||||||
...vp.data,
|
...vp.data,
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user