mirror of
https://github.com/thiloho/aurora.git
synced 2025-11-22 11:31:36 +01:00
Test og:image property
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
---
|
||||
const { title, description } = Astro.props;
|
||||
const { title, description, ogImage = "" } = Astro.props;
|
||||
|
||||
const imageUrl = new URL(ogImage, Astro.url.origin);
|
||||
---
|
||||
|
||||
<head>
|
||||
@@ -14,4 +16,5 @@ const { title, description } = Astro.props;
|
||||
const storedTheme = localStorage.getItem("theme");
|
||||
document.documentElement.className = storedTheme;
|
||||
</script>
|
||||
</head>
|
||||
<meta property="og:image" content={imageUrl} />
|
||||
</head>
|
||||
@@ -7,7 +7,7 @@ import TableOfContents from "../components/TableOfContents.svelte";
|
||||
import PublicationDate from "../components/PublicationDate.astro";
|
||||
---
|
||||
|
||||
<PageLayout {title} {description}>
|
||||
<PageLayout {title} {description} ogImage={cover.src} >
|
||||
<TableOfContents slot="nav" client:only="svelte" {headings} />
|
||||
<Image src={cover} alt={coverAlt} slot="header-before" />
|
||||
<Fragment slot="header">
|
||||
|
||||
@@ -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";
|
||||
---
|
||||
|
||||
<html lang="en">
|
||||
<Head {title} {description} />
|
||||
<Head {title} {description} {ogImage} />
|
||||
<body>
|
||||
<Nav>
|
||||
<slot name="nav" />
|
||||
|
||||
Reference in New Issue
Block a user