--- /** * Custom Hero override for Starlight. * On splash pages: injects the oscilloscope display in the image area. * On other pages: delegates to the default Starlight Hero. */ import { Image } from 'astro:assets'; import { LinkButton } from '@astrojs/starlight/components'; import OscilloscopeDisplay from './OscilloscopeDisplay.astro'; const PAGE_TITLE_ID = '_top'; const { data } = Astro.locals.starlightRoute.entry; const { title = data.title, tagline, image, actions = [] } = data.hero || {}; const isSplash = data.template === 'splash'; const imageAttrs = { loading: 'eager' as const, decoding: 'async' as const, width: 400, height: 400, alt: image?.alt || '', }; let darkImage: ImageMetadata | undefined; let lightImage: ImageMetadata | undefined; let rawHtml: string | undefined; if (image) { if ('file' in image) { darkImage = image.file; } else if ('dark' in image) { darkImage = image.dark; lightImage = image.light; } else { rawHtml = image.html; } } ---
{isSplash ? (
) : ( <> {darkImage && ( )} {lightImage && } {rawHtml &&
} )}

{tagline &&
}
{actions.length > 0 && (
{actions.map( ({ attrs: { class: className, ...attrs } = {}, icon, link: href, text, variant }) => ( {text} {icon?.html && } ) )}
)}