--- import BaseLayout from './BaseLayout.astro'; import SiteFooter from '../components/SiteFooter.astro'; import { getNavigation } from '../data/home'; interface Props { title: string; description?: string; heading: string; /** Sottotitolo opzionale sotto l’H1 */ lead?: string; /** * Stili `@media print` (sfondo chiaro, moduli footer ridotti, modali nascosti). * Imposta `false` se la pagina non deve attivare il foglio stampa dedicato. */ printFriendly?: boolean; } const { title, description = 'NexStudio — software e IA per settori regolamentati.', heading, lead, printFriendly = true, } = Astro.props; const printDate = new Intl.DateTimeFormat('it-IT', { dateStyle: 'long', }).format(new Date()); const printSource = Astro.url.href; const path = Astro.url.pathname; const localeMatch = path.match(/^\/(en|th)(\/|$)/); const currentLocale = (localeMatch?.[1] ?? 'it') as 'it' | 'en' | 'th'; const navigation = getNavigation(currentLocale); const strippedPath = path.replace(/^\/(en|th)(?=\/|$)/, '') || '/'; const localeHref = (locale: 'it' | 'en' | 'th') => { if (locale === 'it') return strippedPath; return `/${locale}${strippedPath === '/' ? '' : strippedPath}`; }; const localize = (href: string) => { if (currentLocale === 'it') return href; if (href.startsWith(`/${currentLocale}`)) return href; if (href.startsWith('/#')) return `/${currentLocale}${href}`; if (href.startsWith('/')) return `/${currentLocale}${href}`; return href; }; const langMeta = { it: { code: 'IT', label: 'Italiano', flagSrc: '/images/flags/it.svg' }, en: { code: 'EN', label: 'English', flagSrc: '/images/flags/en.svg' }, th: { code: 'TH', label: 'ไทย', flagSrc: '/images/flags/th.svg' }, } as const; --- NexStudio {langMeta[currentLocale].code} {langMeta.it.label} {langMeta.it.code} {langMeta.en.label} {langMeta.en.code} {langMeta.th.label} {langMeta.th.code} {navigation.items[4]?.label ?? 'Contattaci'} { printFriendly ? ( {printDate} · {printSource} ) : null } {heading} { lead && ( {lead} ) }
{printDate} · {printSource}
{lead}