--- import Icon from './Icon.astro'; import project from 'virtual:starlight/project-context'; const pagefindTranslations = { placeholder: Astro.locals.t('search.label'), ...Object.fromEntries( Object.entries(Astro.locals.t.all()) .filter(([key]) => key.startsWith('pagefind.')) .map(([key, value]) => [key.replace('pagefind.', ''), value]) ), }; const dataAttributes: DOMStringMap = { 'data-translations': JSON.stringify(pagefindTranslations) }; if (project.trailingSlash === 'never') dataAttributes['data-strip-trailing-slash'] = ''; ---
{ /* TODO: Make the layout of this button flexible to accommodate different word lengths. Currently hard-coded for English: “Cancel” */ } { import.meta.env.DEV ? (

{Astro.locals.t('search.devWarning')}

) : (
) }
{ /** * This is intentionally inlined to avoid briefly showing an invalid shortcut. * Purposely using the deprecated `navigator.platform` property to detect Apple devices, as the * user agent is spoofed by some browsers when opening the devtools. */ }