@devries-cameron20 / composio Mirror · read-only / commits / b071e723d
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 22, 12:00 UTC

docs: replace fumadocs OG image routes with og.composio.dev (#2489)

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>

Rahul Tarak committed Jan 28, 2026 at 00:31 UTC b071e723de7265073c9b867974f338bf0c858dc2
6 files changed +5 -235
docs/app/layout.tsx
+2
@@ -17,11 +17,13 @@ export const metadata: Metadata = {
17 description: 'Build AI agents with 250+ tools. Connect LLMs to external services like GitHub, Slack, Gmail, and more.',
18 siteName: 'Composio Docs',
19 type: 'website',
20 + images: ['https://og.composio.dev/api/og?title=Composio%20Docs'],
21 },
22 twitter: {
23 card: 'summary_large_image',
24 title: 'Composio Docs',
25 description: 'Build AI agents with 250+ tools. Connect LLMs to external services like GitHub, Slack, Gmail, and more.',
26 + images: ['https://og.composio.dev/api/og?title=Composio%20Docs'],
27 },
28 };
29
docs/app/og/docs/[...slug]/route.tsx deleted
-33
@@ -1,33 +0,0 @@
1 -import { source } from '@/lib/source';
2 -import { notFound } from 'next/navigation';
3 -import { ImageResponse } from 'next/og';
4 -import { generate as DefaultImage } from 'fumadocs-ui/og';
5 -
6 -export const revalidate = false;
7 -
8 -export async function GET(
9 - _req: Request,
10 - { params }: { params: Promise<{ slug: string[] }> },
11 -) {
12 - const { slug } = await params;
13 - const page = source.getPage(slug.slice(0, -1));
14 - if (!page) notFound();
15 -
16 - return new ImageResponse(
17 - <DefaultImage
18 - title={page.data.title}
19 - description={page.data.description}
20 - site="Composio"
21 - />,
22 - {
23 - width: 1200,
24 - height: 630,
25 - },
26 - );
27 -}
28 -
29 -export function generateStaticParams() {
30 - return source.getPages().map((page) => ({
31 - slug: [...page.slugs, 'image.png'],
32 - }));
33 -}
docs/app/og/examples/[...slug]/route.tsx deleted
-33
@@ -1,33 +0,0 @@
1 -import { examplesSource } from '@/lib/source';
2 -import { notFound } from 'next/navigation';
3 -import { ImageResponse } from 'next/og';
4 -import { generate as DefaultImage } from 'fumadocs-ui/og';
5 -
6 -export const revalidate = false;
7 -
8 -export async function GET(
9 - _req: Request,
10 - { params }: { params: Promise<{ slug: string[] }> },
11 -) {
12 - const { slug } = await params;
13 - const page = examplesSource.getPage(slug.slice(0, -1));
14 - if (!page) notFound();
15 -
16 - return new ImageResponse(
17 - <DefaultImage
18 - title={page.data.title}
19 - description={page.data.description}
20 - site="Composio"
21 - />,
22 - {
23 - width: 1200,
24 - height: 630,
25 - },
26 - );
27 -}
28 -
29 -export function generateStaticParams() {
30 - return examplesSource.getPages().map((page) => ({
31 - slug: [...page.slugs, 'image.png'],
32 - }));
33 -}
docs/app/og/reference/[...slug]/route.tsx deleted
-56
@@ -1,56 +0,0 @@
1 -import { referenceSource } from '@/lib/source';
2 -import { notFound } from 'next/navigation';
3 -import { ImageResponse } from 'next/og';
4 -import { generate as DefaultImage } from 'fumadocs-ui/og';
5 -
6 -export const revalidate = false;
7 -
8 -export async function GET(
9 - _req: Request,
10 - { params }: { params: Promise<{ slug: string[] }> },
11 -) {
12 - const { slug } = await params;
13 - const pageSlug = slug.slice(0, -1); // Remove 'image.png'
14 -
15 - // Index page
16 - if (pageSlug.length === 0) {
17 - return new ImageResponse(
18 - <DefaultImage
19 - title="API Reference"
20 - description="REST API and SDK reference for Composio"
21 - site="Composio"
22 - />,
23 - {
24 - width: 1200,
25 - height: 630,
26 - },
27 - );
28 - }
29 -
30 - const page = referenceSource.getPage(pageSlug);
31 - if (!page) notFound();
32 -
33 - return new ImageResponse(
34 - <DefaultImage
35 - title={page.data.title}
36 - description={page.data.description}
37 - site="Composio"
38 - />,
39 - {
40 - width: 1200,
41 - height: 630,
42 - },
43 - );
44 -}
45 -
46 -export function generateStaticParams() {
47 - // Index page
48 - const indexParam = { slug: ['image.png'] };
49 -
50 - // All reference pages
51 - const pageParams = referenceSource.getPages().map((page) => ({
52 - slug: [...page.slugs, 'image.png'],
53 - }));
54 -
55 - return [indexParam, ...pageParams];
56 -}
docs/app/og/toolkits/[...slug]/route.tsx deleted
-97
@@ -1,97 +0,0 @@
1 -import { toolkitsSource } from '@/lib/source';
2 -import { notFound } from 'next/navigation';
3 -import { ImageResponse } from 'next/og';
4 -import { generate as DefaultImage } from 'fumadocs-ui/og';
5 -import { readFile } from 'fs/promises';
6 -import { join } from 'path';
7 -import type { Toolkit } from '@/types/toolkit';
8 -
9 -export const revalidate = false;
10 -
11 -async function getToolkits(): Promise<Toolkit[]> {
12 - const filePath = join(process.cwd(), 'public/data/toolkits.json');
13 - try {
14 - const data = await readFile(filePath, 'utf-8');
15 - return JSON.parse(data) as Toolkit[];
16 - } catch {
17 - return [];
18 - }
19 -}
20 -
21 -export async function GET(
22 - _req: Request,
23 - { params }: { params: Promise<{ slug: string[] }> },
24 -) {
25 - const { slug } = await params;
26 - const pageSlug = slug.slice(0, -1); // Remove 'image.png'
27 -
28 - // Check MDX first
29 - const page = toolkitsSource.getPage(pageSlug);
30 - if (page) {
31 - return new ImageResponse(
32 - <DefaultImage
33 - title={page.data.title}
34 - description={page.data.description}
35 - site="Composio"
36 - />,
37 - {
38 - width: 1200,
39 - height: 630,
40 - },
41 - );
42 - }
43 -
44 - // Check JSON toolkit
45 - if (pageSlug.length === 1) {
46 - const toolkits = await getToolkits();
47 - const toolkit = toolkits.find((t) => t.slug === pageSlug[0]);
48 - if (toolkit) {
49 - return new ImageResponse(
50 - <DefaultImage
51 - title={`${toolkit.name?.trim() || toolkit.slug}`}
52 - description={toolkit.description || 'Composio Toolkit'}
53 - site="Composio"
54 - />,
55 - {
56 - width: 1200,
57 - height: 630,
58 - },
59 - );
60 - }
61 - }
62 -
63 - // Index page
64 - if (pageSlug.length === 0) {
65 - return new ImageResponse(
66 - <DefaultImage
67 - title="Toolkits"
68 - description="Browse all toolkits supported by Composio"
69 - site="Composio"
70 - />,
71 - {
72 - width: 1200,
73 - height: 630,
74 - },
75 - );
76 - }
77 -
78 - notFound();
79 -}
80 -
81 -export async function generateStaticParams() {
82 - // MDX pages
83 - const mdxParams = toolkitsSource.getPages().map((page) => ({
84 - slug: [...page.slugs, 'image.png'],
85 - }));
86 -
87 - // JSON toolkit pages
88 - const toolkits = await getToolkits();
89 - const jsonParams = toolkits.map((toolkit) => ({
90 - slug: [toolkit.slug, 'image.png'],
91 - }));
92 -
93 - // Index page
94 - const indexParam = { slug: ['image.png'] };
95 -
96 - return [indexParam, ...mdxParams, ...jsonParams];
97 -}
docs/lib/source.ts
+3 -16
@@ -64,25 +64,12 @@ export const toolkitsSource = loader({
64
65 export const changelogEntries = changelog;
66
67 -export function getPageImage(page: InferPageType<typeof source>) {
68 - const segments = [...page.slugs, 'image.png'];
69 -
70 - return {
71 - segments,
72 - url: `/og/docs/${segments.join('/')}`,
73 - };
74 -}
75 -
67 /**
68 * Generate OG image URL for any page section
69 */
79 -export function getOgImageUrl(section: string, slugs: string[], title?: string, description?: string): string {
80 - const params = new URLSearchParams();
81 - if (title) params.set('title', title);
82 - if (description) params.set('description', description);
83 - const query = params.toString() ? `?${params.toString()}` : '';
84 - const slugPath = slugs.length > 0 ? `${slugs.join('/')}/` : '';
85 - return `/og/${section}/${slugPath}image.png${query}`;
70 +export function getOgImageUrl(_section: string, _slugs: string[], title?: string, _description?: string): string {
71 + const encodedTitle = encodeURIComponent(title ?? 'Composio Docs');
72 + return `https://og.composio.dev/api/og?title=${encodedTitle}`;
73 }
74
75 /**