const { publishedTime, modifiedTime, tags = [] } = Astro.props;
---
-
<meta property="og:type" content="article" />
<meta property="article:published_time" content={publishedTime} />
<meta property="article:modified_time" content={modifiedTime} />
<meta name="twitter:creator" content={SiteMetadata.socials.x.username} />
<meta name="twitter:title" content={`${title} | ${SiteMetadata.title}`} />
<meta name="twitter:description" content={description} />
-<meta name="twitter:image" property="og:image" content={`https://v1.screenshot.11ty.dev/${canonicalURL}opengraph/9:16/`} />
-<meta property="og:image:type" content="image/jpeg" />
+<meta name="twitter:image" property="og:image" content={new URL(`opengraph/?title=${title}`, Astro.site)} />
+<meta property="og:image:type" content="image/svg+xml" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:locale" content="en_US" />
<meta property="og:updated_time" content={new Date().toISOString()} />
<title>{`${title} | ${SiteMetadata.title}`}</title>
<link rel="canonical" href={canonicalURL} />
-<link rel="sitemap" href="/sitemap-index.xml" />
+<link rel="sitemap" href={new URL("sitemap-index.xml", Astro.site)} />
<link rel="alternate" type="application/rss+xml" title={SiteMetadata.title} href={new URL("feed.xml", Astro.site)} />
\ No newline at end of file
--- /dev/null
+---
+import '@fontsource-variable/public-sans';
+import SiteMetadata from '@data/metadata.json';
+---
+<svg width="1200" height="630" viewBox="0 0 1200 630" xmlns="http://www.w3.org/2000/svg">
+ <defs>
+ <pattern id="grid" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse">
+ <circle class="dot" cx="2" cy="2" r="1" />
+ </pattern>
+ </defs>
+
+ <rect width="100%" height="100%" fill="url(#grid)"/>
+ <foreignObject x="0" y="0" width="1200" height="600">
+ <div id="title" xmlns="http://www.w3.org/1999/xhtml" />
+ </foreignObject>
+ <text id="description" x="805" y="600">by {SiteMetadata.author.name}</text>
+</svg>
+
+<style>
+ svg {
+ color: #000000;
+ fill: #000000;
+ font-family: "Public Sans Variable", sans-serif;
+ font-feature-settings: "kern" 1, "kern";
+ font-kerning: normal;
+ font-weight: 400;
+ text-anchor: middle;
+ }
+ .dot {
+ fill: #888888;
+ }
+ #title {
+ font-weight: 700;
+ font-size: 5rem;
+ padding: 1rem;
+ }
+ #description {
+ font-size: 5rem;
+ }
+</style>
+
+<script>
+ function decodeHTMLEntities(text: string) {
+ const textarea = document.createElement("textarea");
+ textarea.innerHTML = text;
+ return textarea.value;
+ };
+
+ const params = new URLSearchParams(window.location.search);
+ let rawTitle = params.get("title") || 'Untitled';
+ if (rawTitle.length >= 120) {
+ rawTitle = rawTitle.substring(0, 117) + '…';
+ };
+ const title = decodeHTMLEntities(rawTitle);
+
+ const titleElement = document.getElementById("title");
+ if (titleElement) {
+ titleElement.textContent = title;
+ };
+</script>
\ No newline at end of file