Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(web): migrate site pages to dynamic OG metadata

Richie McIlroyd1830f53f163
diff --git a/apps/web/app/(site)/about/page.tsx b/apps/web/app/(site)/about/page.tsx
index 06c2cc17d..bd21bb738 100644
--- a/apps/web/app/(site)/about/page.tsx
+++ b/apps/web/app/(site)/about/page.tsx
@@ -1,11 +1,15 @@
import type { Metadata } from "next";
import { AboutPage } from "@/components/pages/AboutPage";
+import { buildMarketingMetadata } from "@/lib/og/url";
-export const metadata: Metadata = {
+export const metadata: Metadata = buildMarketingMetadata({
title: "About — Cap",
description:
"Cap is the open source alternative to Loom. Learn why we started Cap and our commitment to privacy, transparency, and community-driven development.",
-};
+ path: "/about",
+ ogTitle: "Why we started Cap",
+ ogTag: "About",
+});
export default function App() {
return <AboutPage />;
diff --git a/apps/web/app/(site)/blog/[slug]/page.tsx b/apps/web/app/(site)/blog/[slug]/page.tsx
index 00f21bdb2..79438b139 100644
--- a/apps/web/app/(site)/blog/[slug]/page.tsx
+++ b/apps/web/app/(site)/blog/[slug]/page.tsx
@@ -7,6 +7,7 @@ import { MDXRemote } from "next-mdx-remote/rsc";
import { AuthorByline } from "@/components/blog/AuthorByline";
import { BlogTemplate } from "@/components/blog/BlogTemplate";
import { ReadyToGetStarted } from "@/components/ReadyToGetStarted";
+import { ogImageUrl } from "@/lib/og/url";
import { getBlogPosts } from "@/utils/blog";
import {
getInteractiveBlogContent,
@@ -39,9 +40,14 @@ export async function generateMetadata(
title: string;
publishedAt: string;
description: string;
- image: string;
+ image?: string;
};
- const ogImage = `${buildEnv.NEXT_PUBLIC_WEB_URL}${image}`;
+ // Posts with real cover art keep it; everything else gets the branded
+ // dynamic OG image.
+ const ogImage =
+ image && image !== "/og.png"
+ ? `${buildEnv.NEXT_PUBLIC_WEB_URL}${image}`
+ : ogImageUrl({ title, tag: "Blog" });
return {
title,
diff --git a/apps/web/app/(site)/blog/page.tsx b/apps/web/app/(site)/blog/page.tsx
index 0e2f79faa..a0ea7b559 100644
--- a/apps/web/app/(site)/blog/page.tsx
+++ b/apps/web/app/(site)/blog/page.tsx
@@ -1,9 +1,15 @@
import type { Metadata } from "next";
import { UpdatesPage } from "@/components/pages/UpdatesPage";
+import { buildMarketingMetadata } from "@/lib/og/url";
-export const metadata: Metadata = {
+export const metadata: Metadata = buildMarketingMetadata({
title: "Blog — Cap",
-};
+ description:
+ "Product updates, guides, and insights from the team building Cap.",
+ path: "/blog",
+ ogTitle: "The Cap blog",
+ ogTag: "Blog",
+});
export default function App() {
return <UpdatesPage />;
diff --git a/apps/web/app/(site)/download/page.tsx b/apps/web/app/(site)/download/page.tsx
index 7b15cf173..b4aa44452 100644
--- a/apps/web/app/(site)/download/page.tsx
+++ b/apps/web/app/(site)/download/page.tsx
@@ -1,9 +1,13 @@
import type { Metadata } from "next";
import { DownloadPage } from "@/components/pages/DownloadPage";
+import { buildMarketingMetadata } from "@/lib/og/url";
-export const metadata: Metadata = {
+export const metadata: Metadata = buildMarketingMetadata({
title: "Download — Cap",
-};
+ path: "/download",
+ ogTitle: "Download Cap for macOS & Windows",
+ ogTag: "Download",
+});
export default function App() {
return <DownloadPage />;
diff --git a/apps/web/app/(site)/download/versions/page.tsx b/apps/web/app/(site)/download/versions/page.tsx
index 7f5e2f5d4..26a736d37 100644
--- a/apps/web/app/(site)/download/versions/page.tsx
+++ b/apps/web/app/(site)/download/versions/page.tsx
@@ -1,6 +1,7 @@
import { format, parseISO } from "date-fns";
import type { Metadata } from "next";
import Link from "next/link";
+import { buildMarketingMetadata } from "@/lib/og/url";
import {
getGitHubReleases,
hasDownloads,
@@ -8,11 +9,14 @@ import {
type ReleaseDownloads,
} from "@/utils/releases";
-export const metadata: Metadata = {
+export const metadata: Metadata = buildMarketingMetadata({
title: "All Versions — Cap",
description:
"Download previous versions of Cap for macOS, Windows, and Linux.",
-};
+ path: "/download/versions",
+ ogTitle: "All Cap versions",
+ ogTag: "Download",
+});
export const revalidate = 60;
diff --git a/apps/web/app/(site)/dpa/page.tsx b/apps/web/app/(site)/dpa/page.tsx
index 990b98766..8d53e9662 100644
--- a/apps/web/app/(site)/dpa/page.tsx
+++ b/apps/web/app/(site)/dpa/page.tsx
@@ -1,10 +1,14 @@
import type { Metadata } from "next";
+import { buildMarketingMetadata } from "@/lib/og/url";
-export const metadata: Metadata = {
+export const metadata: Metadata = buildMarketingMetadata({
title: "Data Processing Agreement - Cap",
description:
"Cap's Data Processing Agreement for GDPR, UK GDPR, and related data protection laws.",
-};
+ path: "/dpa",
+ ogTitle: "Data processing agreement",
+ ogTag: "Legal",
+});
export default function DataProcessingAgreementPage() {
return (
diff --git a/apps/web/app/(site)/faq/page.tsx b/apps/web/app/(site)/faq/page.tsx
index 52acaa73c..97603b6a3 100644
--- a/apps/web/app/(site)/faq/page.tsx
+++ b/apps/web/app/(site)/faq/page.tsx
@@ -1,9 +1,13 @@
import type { Metadata } from "next";
import { FaqPage } from "@/components/pages/FaqPage";
+import { buildMarketingMetadata } from "@/lib/og/url";
-export const metadata: Metadata = {
+export const metadata: Metadata = buildMarketingMetadata({
title: "FAQ — Cap",
-};
+ path: "/faq",
+ ogTitle: "Frequently asked questions",
+ ogTag: "FAQ",
+});
export default function App() {
return <FaqPage />;
diff --git a/apps/web/app/(site)/features/instant-mode/page.tsx b/apps/web/app/(site)/features/instant-mode/page.tsx
index 03f4f170f..d871c0257 100644
--- a/apps/web/app/(site)/features/instant-mode/page.tsx
+++ b/apps/web/app/(site)/features/instant-mode/page.tsx
@@ -1,35 +1,17 @@
import type { Metadata } from "next";
+import { buildMarketingMetadata } from "@/lib/og/url";
import { InstantModePage } from "./InstantModePage";
-export const metadata: Metadata = {
+export const metadata: Metadata = buildMarketingMetadata({
title: "Instant Mode - Quick Screen Recording & Sharing | Cap",
description:
"Record and share instantly with Cap's cloud-powered Instant Mode. Get automatic transcriptions, collaborative comments, shareable links, and team workspaces for fast feedback loops.",
- openGraph: {
- title: "Instant Mode - Quick Screen Recording & Sharing | Cap",
- description:
- "Record and share instantly with Cap's cloud-powered Instant Mode. Get automatic transcriptions, collaborative comments, shareable links, and team workspaces for fast feedback loops.",
- url: "https://cap.so/features/instant-mode",
- siteName: "Cap",
- images: [
- {
- url: "https://cap.so/og.png",
- width: 1200,
- height: 630,
- alt: "Cap Instant Mode",
- },
- ],
- locale: "en_US",
- type: "website",
- },
- twitter: {
- card: "summary_large_image",
- title: "Instant Mode - Quick Screen Recording & Sharing | Cap",
- description:
- "Record and share instantly with Cap's cloud-powered Instant Mode. Get automatic transcriptions, collaborative comments, shareable links, and team workspaces for fast feedback loops.",
- images: ["https://cap.so/og.png"],
- },
-};
+ path: "/features/instant-mode",
+ ogTitle: "Instant Mode — record & share in seconds",
+ ogDescription:
+ "Record and share instantly with automatic transcriptions, comments, and shareable links.",
+ ogTag: "Features",
+});
export default function Page() {
return <InstantModePage />;
diff --git a/apps/web/app/(site)/features/page.tsx b/apps/web/app/(site)/features/page.tsx
index 7ab20f053..951f8810c 100644
--- a/apps/web/app/(site)/features/page.tsx
+++ b/apps/web/app/(site)/features/page.tsx
@@ -1,11 +1,17 @@
import type { Metadata } from "next";
+import { buildMarketingMetadata } from "@/lib/og/url";
import { FeaturesPage } from "./FeaturesPage";
-export const metadata: Metadata = {
+export const metadata: Metadata = buildMarketingMetadata({
title: "Features - Cap",
description:
"Discover all the powerful features Cap offers for screen recording, sharing, and collaboration. From AI-powered tools to advanced editing capabilities.",
-};
+ path: "/features",
+ ogTitle: "Everything Cap can do",
+ ogDescription:
+ "Screen recording, sharing, and collaboration — from AI-powered tools to advanced editing.",
+ ogTag: "Features",
+});
export default function Page() {
return <FeaturesPage />;
diff --git a/apps/web/app/(site)/features/studio-mode/page.tsx b/apps/web/app/(site)/features/studio-mode/page.tsx
index 27b9f0a79..3cf891abb 100644
--- a/apps/web/app/(site)/features/studio-mode/page.tsx
+++ b/apps/web/app/(site)/features/studio-mode/page.tsx
@@ -1,35 +1,17 @@
import type { Metadata } from "next";
+import { buildMarketingMetadata } from "@/lib/og/url";
import { StudioModePage } from "./StudioModePage";
-export const metadata: Metadata = {
+export const metadata: Metadata = buildMarketingMetadata({
title: "Studio Mode - Professional Screen Recording | Cap",
description:
"Create professional-quality screen recordings with Cap Studio Mode. Local recording, 4K 60fps quality, precision editing tools, and complete privacy control.",
- openGraph: {
- title: "Studio Mode - Professional Screen Recording | Cap",
- description:
- "Create professional-quality screen recordings with Cap Studio Mode. Local recording, 4K 60fps quality, precision editing tools, and complete privacy control.",
- url: "https://cap.so/features/studio-mode",
- siteName: "Cap",
- images: [
- {
- url: "https://cap.so/og.png",
- width: 1200,
- height: 630,
- alt: "Cap Studio Mode",
- },
- ],
- locale: "en_US",
- type: "website",
- },
- twitter: {
- card: "summary_large_image",
- title: "Studio Mode - Professional Screen Recording | Cap",
- description:
- "Create professional-quality screen recordings with Cap Studio Mode. Local recording, 4K 60fps quality, precision editing tools, and complete privacy control.",
- images: ["https://cap.so/og.png"],
- },
-};
+ path: "/features/studio-mode",
+ ogTitle: "Studio Mode — pro-quality recordings",
+ ogDescription:
+ "Local recording, 4K 60fps quality, precision editing tools, and complete privacy control.",
+ ogTag: "Features",
+});
export default function Page() {
return <StudioModePage />;
diff --git a/apps/web/app/(site)/oss-friends/page.tsx b/apps/web/app/(site)/oss-friends/page.tsx
index 553547c78..7b9a7d6f0 100644
--- a/apps/web/app/(site)/oss-friends/page.tsx
+++ b/apps/web/app/(site)/oss-friends/page.tsx
@@ -1,11 +1,15 @@
import { ExternalLink } from "lucide-react";
import type { Metadata } from "next";
+import { buildMarketingMetadata } from "@/lib/og/url";
-export const metadata: Metadata = {
+export const metadata: Metadata = buildMarketingMetadata({
title: "OSS Friends — Cap",
description:
"Discover amazing open source projects and tools built by our friends in the community.",
-};
+ path: "/oss-friends",
+ ogTitle: "Our open source friends",
+ ogTag: "Open Source",
+});
interface OSSFriend {
name: string;
diff --git a/apps/web/app/(site)/pricing/page.tsx b/apps/web/app/(site)/pricing/page.tsx
index c6baf1215..fed346e89 100644
--- a/apps/web/app/(site)/pricing/page.tsx
+++ b/apps/web/app/(site)/pricing/page.tsx
@@ -1,9 +1,15 @@
import type { Metadata } from "next";
import { PricingPage } from "@/components/pages/PricingPage";
+import { buildMarketingMetadata } from "@/lib/og/url";
-export const metadata: Metadata = {
+export const metadata: Metadata = buildMarketingMetadata({
title: "Pricing — Cap",
-};
+ description:
+ "Simple, flexible pricing. Get a Desktop License for unlimited local recording and editing, or Cap Pro for unlimited cloud sharing and team features.",
+ path: "/pricing",
+ ogTitle: "Simple, transparent pricing",
+ ogTag: "Pricing",
+});
export default function App() {
return <PricingPage />;
diff --git a/apps/web/app/(site)/privacy/page.tsx b/apps/web/app/(site)/privacy/page.tsx
index fbbf63c5c..d9a3949ba 100644
--- a/apps/web/app/(site)/privacy/page.tsx
+++ b/apps/web/app/(site)/privacy/page.tsx
@@ -1,8 +1,12 @@
import type { Metadata } from "next";
+import { buildMarketingMetadata } from "@/lib/og/url";
-export const metadata: Metadata = {
+export const metadata: Metadata = buildMarketingMetadata({
title: "Privacy Policy — Cap",
-};
+ path: "/privacy",
+ ogTitle: "Privacy policy",
+ ogTag: "Legal",
+});
export default function App() {
return (
diff --git a/apps/web/app/(site)/self-hosting/page.tsx b/apps/web/app/(site)/self-hosting/page.tsx
index 85519542a..8564d73a4 100644
--- a/apps/web/app/(site)/self-hosting/page.tsx
+++ b/apps/web/app/(site)/self-hosting/page.tsx
@@ -1,5 +1,16 @@
+import type { Metadata } from "next";
+import { buildMarketingMetadata } from "@/lib/og/url";
import { SelfHostingPage } from "./SelfHostingPage";
+export const metadata: Metadata = buildMarketingMetadata({
+ title: "Self-hosting — Cap",
+ description:
+ "Deploy Cap on your own infrastructure with full control over your data. Ideal for enterprises and organizations with specific security requirements.",
+ path: "/self-hosting",
+ ogTitle: "Self-host Cap on your own infrastructure",
+ ogTag: "Self-hosting",
+});
+
export default async function SelfHosting() {
return <SelfHostingPage />;
}
diff --git a/apps/web/app/(site)/student-discount/page.tsx b/apps/web/app/(site)/student-discount/page.tsx
index cbc57024f..5759ee9e6 100644
--- a/apps/web/app/(site)/student-discount/page.tsx
+++ b/apps/web/app/(site)/student-discount/page.tsx
@@ -1,11 +1,15 @@
import type { Metadata } from "next";
import { StudentDiscountPage } from "@/components/pages/StudentDiscountPage";
+import { buildMarketingMetadata } from "@/lib/og/url";
-export const metadata: Metadata = {
+export const metadata: Metadata = buildMarketingMetadata({
title: "Student Discount — Cap",
description:
"Students get 30% off Cap's premium plans with code STUDENT50. Perfect for school projects, presentations, and building your portfolio.",
-};
+ path: "/student-discount",
+ ogTitle: "Students get 30% off Cap",
+ ogTag: "Students",
+});
export default function App() {
return <StudentDiscountPage />;
diff --git a/apps/web/app/(site)/support/page.tsx b/apps/web/app/(site)/support/page.tsx
index a800a3a0b..9bfd94bc5 100644
--- a/apps/web/app/(site)/support/page.tsx
+++ b/apps/web/app/(site)/support/page.tsx
@@ -1,11 +1,15 @@
import type { Metadata } from "next";
import { SupportPage } from "@/components/pages/SupportPage";
+import { buildMarketingMetadata } from "@/lib/og/url";
-export const metadata: Metadata = {
+export const metadata: Metadata = buildMarketingMetadata({
title: "Support — Cap",
description:
"Get help with Cap. Join our Discord community, email [email protected], read the docs, or report an issue on GitHub.",
-};
+ path: "/support",
+ ogTitle: "Get help with Cap",
+ ogTag: "Support",
+});
export default function App() {
return <SupportPage />;
diff --git a/apps/web/app/(site)/terms/page.tsx b/apps/web/app/(site)/terms/page.tsx
index 75e07c865..51b69ae5b 100644
--- a/apps/web/app/(site)/terms/page.tsx
+++ b/apps/web/app/(site)/terms/page.tsx
@@ -1,9 +1,13 @@
import type { Metadata } from "next";
import { TermsPage } from "@/components/pages/TermsPage";
+import { buildMarketingMetadata } from "@/lib/og/url";
-export const metadata: Metadata = {
+export const metadata: Metadata = buildMarketingMetadata({
title: "Terms of Service — Cap",
-};
+ path: "/terms",
+ ogTitle: "Terms of service",
+ ogTag: "Legal",
+});
export default function App() {
return <TermsPage />;
diff --git a/apps/web/app/(site)/testimonials/page.tsx b/apps/web/app/(site)/testimonials/page.tsx
index 52c9d8226..e7951e64b 100644
--- a/apps/web/app/(site)/testimonials/page.tsx
+++ b/apps/web/app/(site)/testimonials/page.tsx
@@ -1,4 +1,15 @@
+import type { Metadata } from "next";
import { TestimonialsPage } from "@/components/pages/TestimonialsPage";
+import { buildMarketingMetadata } from "@/lib/og/url";
+
+export const metadata: Metadata = buildMarketingMetadata({
+ title: "Testimonials — Cap",
+ description:
+ "Don't just take our word for it. Here's what our users are saying about their experience with Cap.",
+ path: "/testimonials",
+ ogTitle: "Loved by teams everywhere",
+ ogTag: "Testimonials",
+});
export default function App() {
return <TestimonialsPage />;