]> git.otsuka.systems Git - cotsuka.github.io/commitdiff
use newly generated opengraph images
authorCameron Otsuka <cameron@otsuka.haus>
Fri, 20 Jun 2025 01:08:43 +0000 (18:08 -0700)
committerCameron Otsuka <cameron@otsuka.haus>
Fri, 20 Jun 2025 01:08:43 +0000 (18:08 -0700)
src/components/head/base.astro

index 1aceb91279c2412712feea4092ba093a5720ac1c..7d424fd0774ba40ddb88342059677ba386e54435 100644 (file)
@@ -9,12 +9,6 @@ interface Props {
 }
 
 const canonicalURL = new URL(Astro.url.pathname, Astro.site);
-const canonicalSegments = canonicalURL.pathname.split('/').filter(Boolean);
-const lastSegment = canonicalSegments.pop()
-const newSegment = lastSegment + '-opengraph.png';
-canonicalSegments.push(newSegment);
-const newPath = canonicalSegments.join('/');
-const ogURL = new URL(newPath, Astro.site)
 const favIcon = await getImage({
     src: FavIcon,
     width: 48,
@@ -37,7 +31,7 @@ const { title, description } = Astro.props;
 <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={ogURL} />
+<meta name="twitter:image" property="og:image" content={new URL("opengraph.png", canonicalURL)}  />
 <meta property="og:image:type" content="image/png" />
 <meta property="og:image:width" content="1200" />
 <meta property="og:image:height" content="630" />