Multi-Agent Collaboration for Team and Friends
TypeScript agent-automationagent-orchestrationagent-workflowai-agentsai-collaborationai-memoryai-workforceautonomous-agentsclaude-codeclaude-code-skillscodexcoding-agentmulti-agentmultiple-agentone-person-businessone-person-companyone-person-teamopencodesolopreneur
fix(web): align public page search and sharing metadata
Gus64d6d1c87f74
diff --git a/src/web/blog/src/app/blog/(index)/page.tsx b/src/web/blog/src/app/blog/(index)/page.tsxindex 1101d1b21..68723ee6e 100644--- a/src/web/blog/src/app/blog/(index)/page.tsx+++ b/src/web/blog/src/app/blog/(index)/page.tsx@@ -1,5 +1,5 @@import { ObservedStaticContent } from "@/lib/observability/regions";-import type { Metadata } from "next";+import { buildPublicPageMetadata } from "@/lib/seo/public-page-metadata";import Image from "next/image";import Link from "next/link";import { isGuide } from "@blog/lib/blog/guides";@@ -11,29 +11,17 @@ import { RecentPosts } from "./recent-posts";const pageTitle = "Blog";const description =- "Thoughts on building AI companies, agent collaboration, and the future of personal software.";+ "Read Alook articles on AI agent collaboration, multi-agent workflows, and shared context for teams working with Claude Code, Codex, and other agents.";-export const metadata: Metadata = {- title: pageTitle,+export const metadata = buildPublicPageMetadata({+ title: "Blog — AI Agent Collaboration & Workflows — Alook",description,- alternates: {- canonical: "https://alook.ai/blog",- types: {- "application/rss+xml": "/blog/feed.xml",- "text/markdown": "/llms.txt",- },+ path: "/blog",+ alternateTypes: {+ "application/rss+xml": "/blog/feed.xml",+ "text/markdown": "/llms.txt",},- openGraph: {- title: pageTitle,- description,- url: "https://alook.ai/blog",- },- twitter: {- card: "summary_large_image",- title: pageTitle,- description,- },-};+});const collectionJsonLd = {"@context": "https://schema.org",diff --git a/src/web/blog/src/app/guides/page.tsx b/src/web/blog/src/app/guides/page.tsxindex 27e358745..dad585d60 100644--- a/src/web/blog/src/app/guides/page.tsx+++ b/src/web/blog/src/app/guides/page.tsx@@ -1,21 +1,19 @@import { ObservedStaticContent } from "@/lib/observability/regions";-import type { Metadata } from "next";+import { buildPublicPageMetadata } from "@/lib/seo/public-page-metadata";import { getAllPosts } from "@blog/lib/blog/posts";import { isGuide } from "@blog/lib/blog/guides";import { blogTopics } from "@blog/lib/blog/topics";import { buildBlogIndexModel } from "../blog/(index)/model";import { RecentPosts } from "../blog/(index)/recent-posts";-export const metadata: Metadata = {- title: "Guides",- description: "Practical guides for using specific coding agents together.",- alternates: { canonical: "https://alook.ai/guides" },- openGraph: {- title: "Guides",- description: "Practical guides for using specific coding agents together.",- url: "https://alook.ai/guides",- },-};+const description =+ "Follow Alook guides for coordinating Claude Code, Codex, and OpenCode agents. Share context, assign work, and prevent duplicate tasks.";++export const metadata = buildPublicPageMetadata({+ title: "Guides — Coding Agent Collaboration — Alook",+ description,+ path: "/guides",+});export default async function GuidesPage() {const posts = (await getAllPosts()).filter(isGuide);@@ -26,7 +24,7 @@ export default async function GuidesPage() {<div className="mx-auto max-w-270 px-4 pb-24 pt-12 sm:px-6 sm:pt-20"><ObservedStaticContent key="/guides" pathname="/guides" /><h1 className="font-sans text-3xl font-semibold tracking-tight sm:text-[2.5rem]">Guides</h1>- <p className="mt-4 max-w-2xl text-muted-foreground">Practical guides for using specific coding agents together.</p>+ <p className="mt-4 max-w-2xl text-muted-foreground">{description}</p><RecentPosts posts={articles} topics={blogTopics.filter((topic) => topicIds.has(topic.id))} /></div>);diff --git a/src/web/src/app/(home)/page.tsx b/src/web/src/app/(home)/page.tsxindex 9f4c6bcaf..2f62bfe7c 100644--- a/src/web/src/app/(home)/page.tsx+++ b/src/web/src/app/(home)/page.tsx@@ -1,35 +1,17 @@import { ObservedStaticContent } from "@/lib/observability/regions";-import type { Metadata } from "next";import {LANDING_META_DESCRIPTION,LANDING_META_TITLE,} from "@/components/home/landing-content";import { LandingPage } from "@/components/home/landing-page";import { headers } from "next/headers";-import { SITE_OG_IMAGE } from "@/lib/seo/site-metadata";+import { buildPublicPageMetadata } from "@/lib/seo/public-page-metadata";-const title = LANDING_META_TITLE;-const description = LANDING_META_DESCRIPTION;-export const metadata: Metadata = {- title: { absolute: title },- description,- alternates: { canonical: "https://alook.ai" },- openGraph: {- type: "website",- siteName: "Alook",- title,- description,- url: "https://alook.ai",- images: [SITE_OG_IMAGE],- },- twitter: {- card: "summary_large_image",- site: "@alook_ai",- title,- description,- images: [SITE_OG_IMAGE],- },-};+export const metadata = buildPublicPageMetadata({+ title: LANDING_META_TITLE,+ description: LANDING_META_DESCRIPTION,+ path: "/",+});export default async function Page() {const requestHeaders = await headers();diff --git a/src/web/src/app/_og/homepage-social-image.test.ts b/src/web/src/app/_og/homepage-social-image.test.tsindex 767c5927f..64d55ecdc 100644--- a/src/web/src/app/_og/homepage-social-image.test.ts+++ b/src/web/src/app/_og/homepage-social-image.test.ts@@ -19,7 +19,6 @@ describe("homepage social images", () => {expect(await sharp(og).metadata()).toMatchObject({ format: "png", width: 1200, height: 630 })expect(og.byteLength).toBeLessThan(5 * 1024 * 1024)expect(SITE_OG_IMAGE.alt).toBe("Alook — Share your agents with people you trust")- expect(readFileSync(new URL("page.tsx", home), "utf8").match(/images: \[SITE_OG_IMAGE\]/g)).toHaveLength(2)expect(existsSync(new URL("opengraph-image.tsx", home))).toBe(false)expect(existsSync(new URL("twitter-image.tsx", home))).toBe(false)})diff --git a/src/web/src/app/pricing/page.tsx b/src/web/src/app/pricing/page.tsxindex 98b8808bc..bed687007 100644--- a/src/web/src/app/pricing/page.tsx+++ b/src/web/src/app/pricing/page.tsx@@ -1,12 +1,13 @@-import type { Metadata } from "next"+import { buildPublicPageMetadata } from "@/lib/seo/public-page-metadata"import { Suspense } from "react"import PricingClient from "./pricing-client"-export const metadata: Metadata = {- title: { absolute: "Alook Pricing — Free, Studio, and House Plans" },- description: "Compare Free, Studio, and House plans for your active bots. Bring your own AI models and runtime.",- alternates: { canonical: "/pricing" },-}+export const metadata = buildPublicPageMetadata({+ title: "Pricing — Free, Studio & House Plans — Alook",+ description:+ "Compare Alook Free, Studio, and House plans for active bots and online machines. Bring your own AI models and agent runtimes.",+ path: "/pricing",+});export default function PricingPage() {return <Suspense fallback={<p role="status" className="p-8">Loading plans…</p>}><PricingClient /></Suspense>diff --git a/src/web/src/components/home/landing-content.test.ts b/src/web/src/components/home/landing-content.test.tsindex 505f9e4cf..902846f0a 100644--- a/src/web/src/components/home/landing-content.test.ts+++ b/src/web/src/components/home/landing-content.test.ts@@ -230,7 +230,7 @@ describe("landing content contract", () => {expect(rootRoute).toContain("LandingPage")expect(rootRoute).toContain("getSession")expect(rootRoute).toContain("<LandingPage isLoggedIn={!!session} />")- expect(rootRoute).toContain('canonical: "https://alook.ai"')+ expect(rootRoute).toContain('path: "/"')expect(rootRoute).not.toContain("HomePage")expect(rootRoute).not.toContain("FAQPage")expect(rootRoute).not.toContain("Personal Company")diff --git a/src/web/src/lib/seo/public-page-metadata.test.ts b/src/web/src/lib/seo/public-page-metadata.test.tsnew file mode 100644index 000000000..8adc91529--- /dev/null+++ b/src/web/src/lib/seo/public-page-metadata.test.ts@@ -0,0 +1,64 @@+import { describe, expect, it, vi } from "vitest";+import { buildPublicPageMetadata } from "./public-page-metadata";+import { SITE_OG_IMAGE, SITE_OG_IMAGE_URL } from "./site-metadata";++vi.mock("@/components/home/landing-page", () => ({ LandingPage: () => null }));+vi.mock("@/lib/observability/regions", () => ({ ObservedStaticContent: () => null }));+vi.mock("@/app/pricing/pricing-client", () => ({ default: () => null }));+vi.mock("@blog/lib/blog/posts", () => ({ getAllPosts: vi.fn() }));+vi.mock("@blog/app/blog/(index)/recent-posts", () => ({ RecentPosts: () => null }));++import { metadata as home } from "@/app/(home)/page";+import { metadata as pricing } from "@/app/pricing/page";+import { metadata as blog } from "@blog/app/blog/(index)/page";+import { metadata as guides } from "@blog/app/guides/page";++const pages = [+ ["home", home, "https://alook.ai", "Alook | AI Agent Collaboration for Claude Code & Codex"],+ ["pricing", pricing, "https://alook.ai/pricing", "Pricing — Free, Studio & House Plans — Alook"],+ ["blog", blog, "https://alook.ai/blog", "Blog — AI Agent Collaboration & Workflows — Alook"],+ ["guides", guides, "https://alook.ai/guides", "Guides — Coding Agent Collaboration — Alook"],+] as const;++describe("public page metadata", () => {+ it.each(pages)("keeps %s search and sharing metadata aligned", (_name, metadata, url, title) => {+ expect(metadata.title).toEqual({ absolute: title });+ expect(metadata.description).toEqual(expect.any(String));+ expect(metadata.description!.length).toBeGreaterThan(50);+ expect(metadata.alternates?.canonical).toBe(url);+ expect(metadata.openGraph).toEqual({+ type: "website",+ siteName: "Alook",+ title,+ description: metadata.description,+ url,+ images: [SITE_OG_IMAGE],+ });+ expect(metadata.twitter).toEqual({+ card: "summary_large_image",+ site: "@alook_ai",+ title,+ description: metadata.description,+ images: [SITE_OG_IMAGE_URL],+ });+ });++ it("preserves the approved homepage description and Blog discovery links", () => {+ expect(home.description).toBe(+ "Bring Claude Code and Codex agents into shared chats with Alook. Coordinate multi-agent workflows, share context, and review work with your team.",+ );+ expect(blog.alternates?.types).toEqual({+ "application/rss+xml": "/blog/feed.xml",+ "text/markdown": "/llms.txt",+ });+ });++ it("keeps nested public page canonical URLs under the site origin", () => {+ const metadata = buildPublicPageMetadata({+ title: "Example — Alook",+ description: "Example description",+ path: "/example/nested",+ });+ expect(metadata.alternates?.canonical).toBe("https://alook.ai/example/nested");+ });+});diff --git a/src/web/src/lib/seo/public-page-metadata.ts b/src/web/src/lib/seo/public-page-metadata.tsnew file mode 100644index 000000000..3eb08994e--- /dev/null+++ b/src/web/src/lib/seo/public-page-metadata.ts@@ -0,0 +1,39 @@+import type { Metadata } from "next";+import { SITE_OG_IMAGE, SITE_OG_IMAGE_URL, SITE_URL } from "./site-metadata";++type PublicPageMetadata = {+ title: string;+ description: string;+ path: `/${string}`;+ alternateTypes?: NonNullable<Metadata["alternates"]>["types"];+};++export function buildPublicPageMetadata({+ title,+ description,+ path,+ alternateTypes,+}: PublicPageMetadata): Metadata {+ const url = path === "/" ? SITE_URL : new URL(path, SITE_URL).toString();++ return {+ title: { absolute: title },+ description,+ alternates: { canonical: url, ...(alternateTypes && { types: alternateTypes }) },+ openGraph: {+ type: "website",+ siteName: "Alook",+ title,+ description,+ url,+ images: [SITE_OG_IMAGE],+ },+ twitter: {+ card: "summary_large_image",+ site: "@alook_ai",+ title,+ description,+ images: [SITE_OG_IMAGE_URL],+ },+ };+}