--- import "../styles/global.css"; import { CHROME } from "../data/chrome"; type Props = { title: string; description?: string; ogImage?: string; }; const { title, description, ogImage } = Astro.props; const canonical = new URL(Astro.url.pathname, Astro.site ?? Astro.url).toString(); const og = ogImage ?? new URL("/assets/iftrace-og.svg", Astro.site ?? Astro.url).toString(); const pathname = Astro.url.pathname; const isFr = pathname === "/fr" || pathname.startsWith("/fr/"); const lang = isFr ? "fr" : "en"; const chrome = CHROME[lang]; const homeHref = isFr ? "/fr/" : "/"; const enPath = isFr ? pathname.replace(/^\/fr(?=\/|$)/, "") : pathname; const enHref = enPath === "" || enPath.startsWith("/404") ? "/" : enPath; const frSupportedEnPaths = new Set(["/", "/about/", "/if/trace/", "/if/gov/"]); const frHref = isFr ? pathname : pathname.startsWith("/404") ? "/fr/" : frSupportedEnPaths.has(pathname) ? pathname === "/" ? "/fr/" : `/fr${pathname}` : "/fr/"; const navItems = chrome.primaryNav; const secondaryNavItems = chrome.secondaryNav; const accessLabel = chrome.accessLabel; --- {title} {description && } {description && }