diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 73d8dee..3ded0b5 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -8,14 +8,35 @@ import "../styles/global.css"; interface Props { title?: string; description?: string; + ogImage?: { + url: string; + width: number; + height: number; + type: string; + alt: string; + }; } -const { title = siteConfig.name, description = siteConfig.description } = - Astro.props; +const { + title = siteConfig.name, + description = siteConfig.description, + ogImage, +} = Astro.props; const metaTitle = title === siteConfig.name ? title : `${title} | ${siteConfig.name}`; +const resolvedOgImage = ogImage || { + url: "/logo.webp", + width: 1024, + height: 1024, + type: "image/webp", + alt: "Atash Consulting", +}; + +const siteUrl = Astro.url.href; +const resolvedOgImageUrl = new URL(resolvedOgImage.url, siteUrl).href; + const isProd = import.meta.env.PROD; --- @@ -27,6 +48,15 @@ const isProd = import.meta.env.PROD; + + + + + + + + + {metaTitle} {isProd && (