@devries-cameron20 / composio Mirror · read-only / commits / 0c944a524
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 12:15 UTC

fix(docs): stop reference cards repeating the title as the description

Reference pages fall back to the page title for their meta description. Pass only a real description to the card, and have the route drop any description that merely repeats the title. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Malay Vasa committed Sep 16, 2026 at 20:28 UTC 0c944a524afc6da332028132d4ceba63b9ecaa6a
4 files changed +14 -3
docs/app/(home)/reference/(v31)/[[...slug]]/page.tsx
+2 -1
@@ -104,7 +104,8 @@ export async function generateMetadata({
104 if (!page) notFound();
105
106 const description = page.data.description || page.data.title;
107 - const ogImage = getOgImageUrl('reference', page.slugs, page.data.title, description, {
107 + // The card already shows the title; only pass a description when there is a real one.
108 + const ogImage = getOgImageUrl('reference', page.slugs, page.data.title, page.data.description, {
109 version: 'v3.1',
110 });
111
docs/app/(home)/reference/v3/[[...slug]]/page.tsx
+2 -1
@@ -113,7 +113,8 @@ export async function generateMetadata({
113 if (!page) notFound();
114
115 const description = page.data.description || page.data.title;
116 - const ogImage = getOgImageUrl('reference', page.slugs, page.data.title, description, {
116 + // The card already shows the title; only pass a description when there is a real one.
117 + const ogImage = getOgImageUrl('reference', page.slugs, page.data.title, page.data.description, {
118 version: 'v3',
119 });
120
docs/app/api/og/route.tsx
+3 -1
@@ -159,11 +159,13 @@ export function parseOgParams(request: Request): OgParams {
159 const section = (SECTIONS as readonly string[]).includes(rawSection) ? (rawSection as OgSection) : 'docs';
160 const theme: OgTheme = params.get('theme') === 'light' ? 'light' : 'dark';
161 const title = clip(params.get('title'), TITLE_MAX) || (section === 'home' ? '' : 'Composio Docs');
162 + const description = clip(params.get('description'), DESCRIPTION_MAX);
163 return {
164 section,
165 theme,
166 title,
166 - description: clip(params.get('description'), DESCRIPTION_MAX),
167 + // Some pages fall back to their title as the meta description; never print it twice.
168 + description: description.toLowerCase() === title.toLowerCase() ? '' : description,
169 logo: safeLogo(params.get('logo'), theme),
170 date: clip(params.get('date'), 40) || null,
171 version: clip(params.get('version'), 12) || null,
docs/tests/static/og-image.test.ts
+7
@@ -87,3 +87,10 @@ test('only catalog toolkit titles get the Toolkit suffix', () => {
87 expect(toolkitCardTitle('Toolkits')).toBe('Toolkits');
88 expect(toolkitCardTitle('Premium Tools')).toBe('Premium Tools');
89 });
90 +
91 +test('a description that only repeats the title is dropped', () => {
92 + const dup = parseOgParams(new Request('https://docs.composio.dev/api/og?section=reference&title=Connected%20Accounts&description=connected%20accounts'));
93 + expect(dup.description).toBe('');
94 + const real = parseOgParams(new Request('https://docs.composio.dev/api/og?section=reference&title=Connected%20Accounts&description=Manage%20accounts'));
95 + expect(real.description).toBe('Manage accounts');
96 +});