From 322e059d0da9ab0d6a546a111fabda755bd5f1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=93=B6=E6=B2=B3=E6=B8=A1=E8=88=9F?= Date: Fri, 27 Jan 2023 03:47:09 +0800 Subject: [PATCH] fix: undefined remarkPluginFrontmatter after calling render method (#5927) * Update vite-plugin-content-assets.ts * Add changeset for #5927 Signed-off-by: Anders Kaseorg Signed-off-by: Anders Kaseorg Co-authored-by: Anders Kaseorg --- .changeset/lazy-buttons-prove.md | 5 +++++ packages/astro/src/content/vite-plugin-content-assets.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/lazy-buttons-prove.md diff --git a/.changeset/lazy-buttons-prove.md b/.changeset/lazy-buttons-prove.md new file mode 100644 index 000000000..83a304128 --- /dev/null +++ b/.changeset/lazy-buttons-prove.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix undefined `remarkPluginFrontmatter` after calling `render` method diff --git a/packages/astro/src/content/vite-plugin-content-assets.ts b/packages/astro/src/content/vite-plugin-content-assets.ts index d886765bc..a1d9424ec 100644 --- a/packages/astro/src/content/vite-plugin-content-assets.ts +++ b/packages/astro/src/content/vite-plugin-content-assets.ts @@ -34,7 +34,7 @@ export function astroDelayedAssetPlugin({ mode }: { mode: string }): Plugin { if (isDelayedAsset(id)) { const basePath = id.split('?')[0]; const code = ` - export { Content, getHeadings } from ${JSON.stringify(basePath)}; + export { Content, getHeadings, frontmatter } from ${JSON.stringify(basePath)}; export const collectedLinks = ${JSON.stringify(LINKS_PLACEHOLDER)}; export const collectedStyles = ${JSON.stringify(STYLES_PLACEHOLDER)}; `;