fix: set relativePath on virtual pages to prevent explorer crash

This commit is contained in:
saberzero1 2026-02-26 20:58:17 +01:00
parent 0edec5de2c
commit dd5b794c9b
No known key found for this signature in database

View File

@ -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,
}) })