--- // src/components/SEO.astro // , meta description, canonical, Open Graph och Twitter-kort för en sida. import { business } from '../data/business'; import { normalizePath } from '../lib/url'; export interface Props { title: string; description: string; /** Sökväg utan avslutande snedstreck, t.ex. "/about". Annars härleds den från URL:en. */ path?: string; /** Absolut URL till og:image (MainLayout tar fram en EXIF-fri JPG via getImage). */ imageUrl: string; imageWidth?: number; imageHeight?: number; imageAlt: string; type?: 'website' | 'profile' | 'article'; noindex?: boolean; } const { title, description, path, imageUrl, imageWidth, imageHeight, imageAlt, type = 'website', noindex = false } = Astro.props; const site = Astro.site ?? new URL(business.url); const canonical = new URL(normalizePath(path ?? Astro.url.pathname), site).toString(); --- <title>{title} {noindex ? : } {imageWidth && } {imageHeight && }