diff --git a/packages/starlight/layout/Page.astro b/packages/starlight/layout/Page.astro index 0999122dffc..014ea8d51fe 100644 --- a/packages/starlight/layout/Page.astro +++ b/packages/starlight/layout/Page.astro @@ -1,6 +1,8 @@ --- import config from 'virtual:starlight/user-config'; import type { MarkdownHeading } from 'astro'; +import { ViewTransitions } from 'astro:transitions'; + import { getSidebar } from '../utils/navigation'; import type { Route } from '../utils/routing'; @@ -84,6 +86,7 @@ const pagefindEnabled = } } + { entry.data.viewTransitions && } diff --git a/packages/starlight/schema.ts b/packages/starlight/schema.ts index d0775e709cb..332a025ce9a 100644 --- a/packages/starlight/schema.ts +++ b/packages/starlight/schema.ts @@ -59,6 +59,12 @@ export function docsSchema() { */ template: z.enum(['doc', 'splash']).default('doc'), + /** + * Set ViewTransitions Astro component for this page. + * + */ + viewTransitions: z.boolean().optional().default(false), + /** Display a hero section on this page. */ hero: z .object({