--- import { SITE } from '../site.config'; import i18next, { t } from "i18next"; import { Trans, HeadHrefLangs } from "astro-i18next/components"; import { localizePath } from "astro-i18next"; import '../styles/global.css'; export interface Props { title?: string; description?: string; image?: string; keywords?: string; } const { title = t('site.title'), description = t('site.description'), image = SITE.ogImage, keywords = t('meta.keywords') } = Astro.props; const lang = Astro.currentLocale || 'en'; // Safe URL creation with fallbacks let canonicalURL; let ogImageURL; let twitterImageURL; try { const siteURL = Astro.site || new URL('http://localhost:4321'); canonicalURL = new URL(Astro.url.pathname, siteURL); ogImageURL = new URL(image, siteURL); twitterImageURL = new URL(image, siteURL); } catch (error) { // Fallback URLs if there's an issue const fallbackSite = 'https://tiber365.it'; canonicalURL = new URL(Astro.url?.pathname || '/', fallbackSite); ogImageURL = new URL(image, fallbackSite); twitterImageURL = new URL(image, fallbackSite); } const fullTitle = title === t('site.title') ? title : `${title} | ${t('site.title')}`; // Get all available locales const locales = ["en", "nl", "it"]; --- {keywords && } {fullTitle} {locales.map(locale => ( ))}