diff --git a/astro.config.mjs b/astro.config.mjs index 3182e6d..0c78087 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -43,6 +43,7 @@ export default defineConfig({ output: 'static', compressHTML: true, // Astro 7 defaults to 'jsx', which drops whitespace between inline elements trailingSlash: 'always', // Pages live at /page/; dist/_redirects sends /page there with a 301 + prefetch: false, // Home and About's ClientRouter (IntroRouter.astro) would otherwise prefetch every link hovered vite: { resolve: { preserveSymlinks: true diff --git a/src/components/Background.astro b/src/components/Background.astro index 38792f8..57fc802 100644 --- a/src/components/Background.astro +++ b/src/components/Background.astro @@ -6,15 +6,24 @@ // The pattern alone makes way, so the paper keeps going: around the topic map (TopicMap.astro), clear inside the // ellipse that fits the map's box and back to full strength at 1.55 times that size; on a page with the centred 720px // text column (textColumn), behind a band as wide as the column, fading out between 16px and 112px on each side. +// +// With `persist`, going between Home and About without a full page load (IntroRouter.astro), the router keeps this +// element as it is drawn, and its hole moves to the next page's map. A page with the text column has its own mask, so +// it never shares the element. interface Props { /** The page has the centred 720px text column of articles: the pattern is cleared behind it. */ textColumn?: boolean; + /** Keep the element, as drawn, when the router (IntroRouter.astro) goes to another page that keeps it. */ + persist?: boolean; } -const { textColumn = false } = Astro.props; +const { textColumn = false, persist = false } = Astro.props; +// The attribute that transition:persist sets. The directive itself would also add Astro's view transition styles to +// every page with the background, the 404 page and /documents/ included, which never use the router. +const keep = persist && !textColumn ? 'page-background' : undefined; --- -