Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
fix(marketing): make X load the social card
Leo4f8837aa3e41
diff --git a/apps/marketing/package.json b/apps/marketing/package.jsonindex b49a6a4d0..5d4a415ff 100644--- a/apps/marketing/package.json+++ b/apps/marketing/package.json@@ -18,6 +18,7 @@"@astrojs/check": "^0.9.7","@effect/vitest": "catalog:","@vercel/config": "^0.3.0",+ "jpeg-js": "0.4.4","typescript": "catalog:"}}diff --git a/apps/marketing/public/og-v2.jpg b/apps/marketing/public/og-v2.jpgnew file mode 100644index 000000000..d5272b39bBinary files /dev/null and b/apps/marketing/public/og-v2.jpg differdiff --git a/apps/marketing/src/layouts/Layout.astro b/apps/marketing/src/layouts/Layout.astroindex 6603c1afc..daafad1ad 100644--- a/apps/marketing/src/layouts/Layout.astro+++ b/apps/marketing/src/layouts/Layout.astro@@ -33,7 +33,8 @@ const siteOrigin = Astro.site ?? new URL(Astro.url.origin);const canonicalPath =Astro.url.pathname === "/" ? "/" : Astro.url.pathname.replace(/\/+$/, "");const canonicalUrl = new URL(canonicalPath, siteOrigin);-const socialImageUrl = new URL("/og.png", siteOrigin);+const socialImageUrl = new URL("/og-v2.jpg", siteOrigin);+const socialImageAlt = "Meet Akeru Bot. Each bot keeps its own tools and its own memory.";const year = new Date().getFullYear();const softwareDescription ="Open-source desktop and web application for running coding agents with separate tools, plugins, instructions, and long-term memory.";@@ -81,18 +82,16 @@ const structuredData = [<meta property="og:image" content={socialImageUrl.href} />{articlePublishedTime && <meta property="article:published_time" content={articlePublishedTime} />}{articleModifiedTime && <meta property="article:modified_time" content={articleModifiedTime} />}- <meta property="og:image:type" content="image/png" />- <meta property="og:image:width" content="2400" />- <meta property="og:image:height" content="1260" />- <meta- property="og:image:alt"- content="Meet Akeru Bot. Each bot keeps its own tools and its own memory."- />+ <meta property="og:image:type" content="image/jpeg" />+ <meta property="og:image:width" content="1200" />+ <meta property="og:image:height" content="630" />+ <meta property="og:image:alt" content={socialImageAlt} /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content={socialTitle ?? title} /><meta name="twitter:description" content={description} /><meta name="twitter:image" content={socialImageUrl.href} />+ <meta name="twitter:image:alt" content={socialImageAlt} /><link rel="preconnect" href="https://fonts.googleapis.com" /><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />diff --git a/apps/marketing/src/seo.test.ts b/apps/marketing/src/seo.test.tsindex 259bca0de..7d48642df 100644--- a/apps/marketing/src/seo.test.ts+++ b/apps/marketing/src/seo.test.ts@@ -1,11 +1,30 @@import * as NodeFS from "node:fs";import * as NodePath from "node:path";+import * as JPEG from "jpeg-js";import { describe, expect, it } from "vite-plus/test";const sourceFile = (path: string) =>NodeFS.readFileSync(NodePath.resolve(import.meta.dirname, path), "utf8");+const jpegFrameMarker = (image: Buffer) => {+ let offset = 2;++ while (offset < image.byteLength) {+ while (image[offset] === 0xff) offset += 1;+ const marker = image[offset];+ offset += 1;++ if (marker >= 0xc0 && marker <= 0xc3) return marker;+ if (marker === 0xda || marker === undefined) break;++ const segmentLength = image.readUInt16BE(offset);+ offset += segmentLength;+ }++ return undefined;+};+describe("marketing search metadata", () => {it("keeps search metadata while preserving the original home page", () => {const home = sourceFile("pages/index.astro");@@ -106,6 +125,24 @@ describe("marketing search metadata", () => {expect(searchPage).toContain("overflow-x: auto;");});+ it("serves a crawler-compatible social card from a cache-busted URL", () => {+ const layout = sourceFile("layouts/Layout.astro");+ const socialImage = NodeFS.readFileSync(+ NodePath.resolve(import.meta.dirname, "../public/og-v2.jpg"),+ );+ const decoded = JPEG.decode(socialImage, { formatAsRGBA: false, useTArray: true });++ expect(layout).toContain('new URL("/og-v2.jpg", siteOrigin)');+ expect(layout).toContain('<meta property="og:image:type" content="image/jpeg" />');+ expect(layout).toContain('<meta property="og:image:width" content="1200" />');+ expect(layout).toContain('<meta property="og:image:height" content="630" />');+ expect(layout).toContain('<meta name="twitter:image:alt"');+ expect(jpegFrameMarker(socialImage)).toBe(0xc0);+ expect(decoded).toMatchObject({ width: 1200, height: 630 });+ expect(decoded.data.byteLength).toBe(1200 * 630 * 3);+ expect(socialImage.byteLength).toBeLessThan(5_000_000);+ });+it("keeps missing pages out of search results", () => {const layout = sourceFile("layouts/Layout.astro");const notFound = sourceFile("pages/404.astro");diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex a2c2a453e..af66c4ad2 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -194,6 +194,9 @@ importers:'@vercel/config':specifier: ^0.3.0version: 0.3.0+ jpeg-js:+ specifier: 0.4.4+ version: 0.4.4typescript:specifier: 'catalog:'version: 6.0.3@@ -16126,7 +16129,7 @@ snapshots:postcss: 8.5.26resolve-from: 5.0.0optionalDependencies:- expo: 56.0.12(8895228379997a2a064f9644cda56ed0)+ expo: 56.0.12(deb8cbf3e0f411b34ba85a995c9982ba)transitivePeerDependencies:- bufferutil- supports-color@@ -20786,8 +20789,8 @@ snapshots:react-refresh: 0.14.2optionalDependencies:'@babel/runtime': 7.29.7- expo: 56.0.12(8895228379997a2a064f9644cda56ed0)- expo-widgets: 56.0.19(3cdc0dde9f93166d952f1e1bd0cb25c0)+ expo: 56.0.12(deb8cbf3e0f411b34ba85a995c9982ba)+ expo-widgets: 56.0.19(32843e0c0883df8bccfa0b8323659df5)transitivePeerDependencies:- '@babel/core'- supports-color@@ -22686,6 +22689,22 @@ snapshots:expo: 56.0.12(8895228379997a2a064f9644cda56ed0)react-native: 0.85.3(@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])+ [email protected](32843e0c0883df8bccfa0b8323659df5):+ dependencies:+ '@expo/plist': 0.7.0+ '@expo/ui': 56.0.18(32843e0c0883df8bccfa0b8323659df5)+ expo: 56.0.12(deb8cbf3e0f411b34ba85a995c9982ba)+ react: 19.2.6+ react-native: 0.85.3(@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])+ transitivePeerDependencies:+ - '@babel/core'+ - '@types/react'+ - '@types/react-dom'+ - react-dom+ - react-native-reanimated+ - react-native-worklets+ optional: true+[email protected](3cdc0dde9f93166d952f1e1bd0cb25c0):dependencies:'@expo/plist': 0.7.0