Skip to content

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

Add linkable changelog entries with copy-to-clipboard

Sushmithamalleshe5479d4e9f9e
diff --git a/fumadocs/app/(home)/docs/changelog/[...slug]/page.tsx b/fumadocs/app/(home)/docs/changelog/[...slug]/page.tsx
new file mode 100644
index 000000000..e2ed43141
--- /dev/null
+++ b/fumadocs/app/(home)/docs/changelog/[...slug]/page.tsx
@@ -0,0 +1,102 @@
+import { changelogEntries, formatDate, dateToSlug, slugToDate } from '@/lib/source';
+import { getMDXComponents } from '@/mdx-components';
+import {
+ DocsBody,
+ DocsDescription,
+ DocsPage,
+ DocsTitle,
+} from 'fumadocs-ui/layouts/docs/page';
+import { notFound } from 'next/navigation';
+import Link from 'next/link';
+import { ChevronLeft } from 'lucide-react';
+
+const mdxComponents = getMDXComponents();
+
+interface PageProps {
+ params: Promise<{ slug: string[] }>;
+}
+
+export default async function ChangelogEntryPage({ params }: PageProps) {
+ const { slug } = await params;
+ const dateStr = slugToDate(slug);
+
+ if (!dateStr) {
+ notFound();
+ }
+
+ // Find entries matching this date
+ const matchingEntries = changelogEntries.filter(
+ (entry) => entry.date === dateStr
+ );
+
+ if (matchingEntries.length === 0) {
+ notFound();
+ }
+
+ // If there are multiple entries for the same date, show all of them
+ return (
+ <DocsPage toc={[]} footer={{ enabled: false }}>
+ <Link
+ href="/docs/changelog"
+ className="inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mb-4 transition-colors"
+ >
+ <ChevronLeft className="w-4 h-4" />
+ Back to Changelog
+ </Link>
+
+ <DocsTitle>{formatDate(dateStr)}</DocsTitle>
+ <DocsDescription>Latest updates and announcements</DocsDescription>
+
+ <DocsBody>
+ <div className="space-y-12">
+ {matchingEntries.map((entry) => {
+ const Content = entry.body;
+ return (
+ <article key={`${entry.date}-${entry.title}`}>
+ <h2 className="text-2xl font-semibold mb-4">{entry.title}</h2>
+ <div className="prose prose-neutral dark:prose-invert max-w-none">
+ <Content components={mdxComponents} />
+ </div>
+ </article>
+ );
+ })}
+ </div>
+ </DocsBody>
+ </DocsPage>
+ );
+}
+
+export function generateStaticParams() {
+ const uniqueDates = new Set<string>();
+
+ for (const entry of changelogEntries) {
+ uniqueDates.add(entry.date);
+ }
+
+ return Array.from(uniqueDates).map((date) => ({
+ slug: dateToSlug(date),
+ }));
+}
+
+export async function generateMetadata({ params }: PageProps) {
+ const { slug } = await params;
+ const dateStr = slugToDate(slug);
+ if (!dateStr) return { title: 'Not Found' };
+
+ const matchingEntries = changelogEntries.filter(
+ (entry) => entry.date === dateStr
+ );
+
+ if (matchingEntries.length === 0) {
+ return { title: 'Not Found' };
+ }
+
+ const title = matchingEntries.length === 1
+ ? matchingEntries[0].title
+ : `Changelog - ${formatDate(dateStr)}`;
+
+ return {
+ title: `${title} | Composio Changelog`,
+ description: `Updates from ${formatDate(dateStr)}`,
+ };
+}
diff --git a/fumadocs/app/(home)/docs/changelog/page.tsx b/fumadocs/app/(home)/docs/changelog/page.tsx
index 8c191712e..616f5184c 100644
--- a/fumadocs/app/(home)/docs/changelog/page.tsx
+++ b/fumadocs/app/(home)/docs/changelog/page.tsx
@@ -1,4 +1,4 @@
-import { changelogEntries, formatDate } from '@/lib/source';
+import { changelogEntries, formatDate, dateToChangelogUrl } from '@/lib/source';
import { getMDXComponents } from '@/mdx-components';
import {
DocsBody,
@@ -6,6 +6,7 @@ import {
DocsPage,
DocsTitle,
} from 'fumadocs-ui/layouts/docs/page';
+import { CopyLink } from '@/components/copy-link';
const mdxComponents = getMDXComponents();
@@ -17,7 +18,7 @@ export default function ChangelogPage() {
return (
<DocsPage toc={[]} footer={{ enabled: false }}>
<DocsTitle>Changelog</DocsTitle>
- <DocsDescription>New updates and improvements to Composio.</DocsDescription>
+ <DocsDescription>Latest updates and announcements</DocsDescription>
<DocsBody>
<div className="relative">
{/* Timeline line */}
@@ -30,10 +31,13 @@ export default function ChangelogPage() {
return (
<article key={`${entry.date}-${entry.title}`} className="relative">
{/* Date column */}
- <div className="mb-3 md:absolute md:left-0 md:w-24 md:text-right md:pr-8">
- <time className="text-sm font-medium text-muted-foreground">
+ <div className="mb-3 md:absolute md:left-0 md:w-28 md:text-right md:pr-6">
+ <CopyLink
+ href={dateToChangelogUrl(entry.date)}
+ className="text-sm font-medium text-orange-500 hover:text-orange-600 transition-colors"
+ >
{formatDate(entry.date)}
- </time>
+ </CopyLink>
</div>
{/* Timeline dot */}
diff --git a/fumadocs/components/copy-link.tsx b/fumadocs/components/copy-link.tsx
new file mode 100644
index 000000000..c0e56ec36
--- /dev/null
+++ b/fumadocs/components/copy-link.tsx
@@ -0,0 +1,36 @@
+'use client';
+
+import { useState } from 'react';
+import { Link, Check } from 'lucide-react';
+
+interface CopyLinkProps {
+ href: string;
+ children: React.ReactNode;
+ className?: string;
+}
+
+export function CopyLink({ href, children, className }: CopyLinkProps) {
+ const [copied, setCopied] = useState(false);
+
+ const handleCopy = async () => {
+ const fullUrl = `${window.location.origin}${href}`;
+ await navigator.clipboard.writeText(fullUrl);
+ setCopied(true);
+ setTimeout(() => setCopied(false), 2000);
+ };
+
+ return (
+ <button
+ onClick={handleCopy}
+ className={`inline-flex items-center gap-1.5 group cursor-pointer whitespace-nowrap ${className}`}
+ title="Copy link"
+ >
+ <span>{children}</span>
+ {copied ? (
+ <Check className="w-3 h-3 text-green-500" />
+ ) : (
+ <Link className="w-3 h-3 opacity-0 group-hover:opacity-70 transition-opacity" />
+ )}
+ </button>
+ );
+}
diff --git a/fumadocs/lib/source.ts b/fumadocs/lib/source.ts
index 006f3f27e..7c25c2ae2 100644
--- a/fumadocs/lib/source.ts
+++ b/fumadocs/lib/source.ts
@@ -32,7 +32,26 @@ export function formatDate(dateStr: string): string {
// Add T12:00 to avoid UTC midnight timezone shift
return new Date(`${dateStr}T12:00:00`).toLocaleDateString('en-US', {
year: 'numeric',
- month: 'long',
+ month: 'short',
day: 'numeric',
});
}
+
+export function dateToChangelogUrl(dateStr: string): string {
+ // Convert "2025-12-29" to "/docs/changelog/2025/12/29"
+ const [year, month, day] = dateStr.split('-');
+ return `/docs/changelog/${year}/${month}/${day}`;
+}
+
+export function dateToSlug(dateStr: string): string[] {
+ // Convert "2025-12-29" to ["2025", "12", "29"]
+ const [year, month, day] = dateStr.split('-');
+ return [year, month, day];
+}
+
+export function slugToDate(slug: string[]): string | null {
+ // Convert ["2025", "12", "29"] to "2025-12-29"
+ if (slug.length !== 3) return null;
+ const [year, month, day] = slug;
+ return `${year}-${month}-${day}`;
+}