From 1f1d9fb4338afb1b136f30c1e4d3a7978b2ab8d3 Mon Sep 17 00:00:00 2001 From: Maya Kid <29959320+Maya-Kid@users.noreply.github.com> Date: Thu, 15 Oct 2026 18:46:52 +1100 Subject: [PATCH 1/2] Match copied block imports to the file tree shown to readers. Signed-off-by: Maya Kid <29959320+Maya-Kid@users.noreply.github.com> --- src/blocks/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/blocks/index.ts b/src/blocks/index.ts index 645c80c..7b5011f 100644 --- a/src/blocks/index.ts +++ b/src/blocks/index.ts @@ -58,7 +58,13 @@ function filesOf(name: string, own?: boolean) { path: "shared/overview.tsx", source: sources["/src/blocks/shared/overview.tsx"], }); - return files; + // Previews use the site's block folders; copied files live at the paths shown above. + return files.map((file) => ({ + ...file, + source: file.source + .replaceAll(`@/blocks/${name}/`, "@/") + .replaceAll("@/blocks/shared/", "@/shared/"), + })); } const OVERVIEW = "@/blocks/shared/overview"; From 88b9773871eca28cb616e0ce2225ce4e8827bd29 Mon Sep 17 00:00:00 2001 From: Maya Kid <29959320+Maya-Kid@users.noreply.github.com> Date: Thu, 15 Oct 2026 19:13:14 +1100 Subject: [PATCH 2/2] fix: omit preview metadata from copied block pages Signed-off-by: Maya Kid <29959320+Maya-Kid@users.noreply.github.com> --- src/blocks/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/blocks/index.ts b/src/blocks/index.ts index 7b5011f..f3cdfa9 100644 --- a/src/blocks/index.ts +++ b/src/blocks/index.ts @@ -61,7 +61,10 @@ function filesOf(name: string, own?: boolean) { // Previews use the site's block folders; copied files live at the paths shown above. return files.map((file) => ({ ...file, - source: file.source + // Upstream preview metadata is not a supported Next App Router page export. + source: (file.path === "page.tsx" + ? file.source.replace(/^export const (?:iframeHeight|description) = [^\n]*\n\n?/gm, "") + : file.source) .replaceAll(`@/blocks/${name}/`, "@/") .replaceAll("@/blocks/shared/", "@/shared/"), }));