fix(marketing): show a real preview card when t3.codes is shared (#10305)
Co-authored-by: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
272d6d747e
commit
d924fe2664
2 files changed
+33
-1
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import { defineConfig } from "astro/config";
|
||||
|
||||
export default defineConfig({
|
||||
site: "https://t3.codes",
|
||||
server: {
|
||||
port: Number(process.env.PORT ?? 4173),
|
||||
},
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
import { Image } from "astro:assets";
|
||||
import { getImage, Image } from "astro:assets";
|
||||
import appIcon from "../assets/icon.webp";
|
||||
import desktopScreenshot from "../assets/app-desktop.webp";
|
||||
import dmSansLatinUrl from "../assets/fonts/dm-sans-latin.woff2?url";
|
||||
import "../styles/fonts.css";
|
||||
import {
|
||||
@@ -21,6 +22,21 @@ const {
|
||||
description = "T3 Code. The open-source control plane for coding agents.",
|
||||
pageClass,
|
||||
} = Astro.props;
|
||||
|
||||
// Social preview card. Link unfurlers (Instagram, iMessage, X, Slack) want a
|
||||
// 1200x630 jpg or png at an absolute URL. Built from the hero screenshot so it
|
||||
// stays in sync with the homepage.
|
||||
const socialImage = await getImage({
|
||||
src: desktopScreenshot,
|
||||
width: 1200,
|
||||
height: 630,
|
||||
fit: "cover",
|
||||
position: "top",
|
||||
format: "jpg",
|
||||
quality: 90,
|
||||
});
|
||||
const socialImageUrl = new URL(socialImage.src, Astro.site);
|
||||
const canonicalUrl = new URL(Astro.url.pathname, Astro.site);
|
||||
---
|
||||
|
||||
<html lang="en">
|
||||
@@ -28,6 +44,21 @@ const {
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content={description} />
|
||||
<link rel="canonical" href={canonicalUrl} />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:site_name" content="T3 Code" />
|
||||
<meta property="og:url" content={canonicalUrl} />
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:image" content={socialImageUrl} />
|
||||
<meta property="og:image:width" content="1200" />
|
||||
<meta property="og:image:height" content="630" />
|
||||
<meta property="og:image:alt" content="The T3 Code desktop app with a thread open." />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:site" content="@t3dotgg" />
|
||||
<meta name="twitter:title" content={title} />
|
||||
<meta name="twitter:description" content={description} />
|
||||
<meta name="twitter:image" content={socialImageUrl} />
|
||||
<link
|
||||
rel="preload"
|
||||
href={dmSansLatinUrl}
|
||||
|
||||
Reference in new issue
Block a user