diff --git a/src/components/Head.astro b/src/components/Head.astro index f6e9a18..75f76b5 100644 --- a/src/components/Head.astro +++ b/src/components/Head.astro @@ -1,5 +1,7 @@ --- -const { title, description } = Astro.props; +const { title, description, ogImage = "" } = Astro.props; + +const imageUrl = new URL(ogImage, Astro.url.origin); --- @@ -14,4 +16,5 @@ const { title, description } = Astro.props; const storedTheme = localStorage.getItem("theme"); document.documentElement.className = storedTheme; - + + \ No newline at end of file diff --git a/src/layouts/ArticleLayout.astro b/src/layouts/ArticleLayout.astro index cfa7eee..3311eeb 100644 --- a/src/layouts/ArticleLayout.astro +++ b/src/layouts/ArticleLayout.astro @@ -7,7 +7,7 @@ import TableOfContents from "../components/TableOfContents.svelte"; import PublicationDate from "../components/PublicationDate.astro"; --- - + {coverAlt} diff --git a/src/layouts/PageLayout.astro b/src/layouts/PageLayout.astro index 54f20be..4954eee 100644 --- a/src/layouts/PageLayout.astro +++ b/src/layouts/PageLayout.astro @@ -1,5 +1,5 @@ --- -const { title, description } = Astro.props; +const { title, description, ogImage } = Astro.props; import "open-props/style"; import "../styles/global.css"; @@ -13,7 +13,7 @@ import Footer from "../components/Footer.astro"; --- - +