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, 15:45 UTC
Add linkable changelog entries with copy-to-clipboard
- Add individual changelog pages at /docs/changelog/YYYY/MM/DD - Add CopyLink component for copying entry URLs on click - Centralize date utilities in lib/source.ts - Use short date format (Dec 29, 2025) and orange styling - Update description to "Latest updates and announcements" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sushmithamallesh committed
Dec 30, 2025 at 00:12 UTC
e5479d4e9f9eaa103c6a1dd43526213a8cf86682
4 files changed
+167
-6
fumadocs/app/(home)/docs/changelog/[...slug]/page.tsx
new
+102
@@ -0,0 +1,102 @@
1
+import { changelogEntries, formatDate, dateToSlug, slugToDate } from '@/lib/source';
2
+import { getMDXComponents } from '@/mdx-components';
3
+import {
4
+ DocsBody,
5
+ DocsDescription,
6
+ DocsPage,
7
+ DocsTitle,
8
+} from 'fumadocs-ui/layouts/docs/page';
9
+import { notFound } from 'next/navigation';
10
+import Link from 'next/link';
11
+import { ChevronLeft } from 'lucide-react';
12
+
13
+const mdxComponents = getMDXComponents();
14
+
15
+interface PageProps {
16
+ params: Promise<{ slug: string[] }>;
17
+}
18
+
19
+export default async function ChangelogEntryPage({ params }: PageProps) {
20
+ const { slug } = await params;
21
+ const dateStr = slugToDate(slug);
22
+
23
+ if (!dateStr) {
24
+ notFound();
25
+ }
26
+
27
+ // Find entries matching this date
28
+ const matchingEntries = changelogEntries.filter(
29
+ (entry) => entry.date === dateStr
30
+ );
31
+
32
+ if (matchingEntries.length === 0) {
33
+ notFound();
34
+ }
35
+
36
+ // If there are multiple entries for the same date, show all of them
37
+ return (
38
+ <DocsPage toc={[]} footer={{ enabled: false }}>
39
+ <Link
40
+ href="/docs/changelog"
41
+ className="inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mb-4 transition-colors"
42
+ >
43
+ <ChevronLeft className="w-4 h-4" />
44
+ Back to Changelog
45
+ </Link>
46
+
47
+ <DocsTitle>{formatDate(dateStr)}</DocsTitle>
48
+ <DocsDescription>Latest updates and announcements</DocsDescription>
49
+
50
+ <DocsBody>
51
+ <div className="space-y-12">
52
+ {matchingEntries.map((entry) => {
53
+ const Content = entry.body;
54
+ return (
55
+ <article key={`${entry.date}-${entry.title}`}>
56
+ <h2 className="text-2xl font-semibold mb-4">{entry.title}</h2>
57
+ <div className="prose prose-neutral dark:prose-invert max-w-none">
58
+ <Content components={mdxComponents} />
59
+ </div>
60
+ </article>
61
+ );
62
+ })}
63
+ </div>
64
+ </DocsBody>
65
+ </DocsPage>
66
+ );
67
+}
68
+
69
+export function generateStaticParams() {
70
+ const uniqueDates = new Set<string>();
71
+
72
+ for (const entry of changelogEntries) {
73
+ uniqueDates.add(entry.date);
74
+ }
75
+
76
+ return Array.from(uniqueDates).map((date) => ({
77
+ slug: dateToSlug(date),
78
+ }));
79
+}
80
+
81
+export async function generateMetadata({ params }: PageProps) {
82
+ const { slug } = await params;
83
+ const dateStr = slugToDate(slug);
84
+ if (!dateStr) return { title: 'Not Found' };
85
+
86
+ const matchingEntries = changelogEntries.filter(
87
+ (entry) => entry.date === dateStr
88
+ );
89
+
90
+ if (matchingEntries.length === 0) {
91
+ return { title: 'Not Found' };
92
+ }
93
+
94
+ const title = matchingEntries.length === 1
95
+ ? matchingEntries[0].title
96
+ : `Changelog - ${formatDate(dateStr)}`;
97
+
98
+ return {
99
+ title: `${title} | Composio Changelog`,
100
+ description: `Updates from ${formatDate(dateStr)}`,
101
+ };
102
+}
fumadocs/app/(home)/docs/changelog/page.tsx
+9
-5
@@ -1,4 +1,4 @@
1
-import { changelogEntries, formatDate } from '@/lib/source';
1
+import { changelogEntries, formatDate, dateToChangelogUrl } from '@/lib/source';
2
import { getMDXComponents } from '@/mdx-components';
3
import {
4
DocsBody,
@@ -6,6 +6,7 @@ import {
6
DocsPage,
7
DocsTitle,
8
} from 'fumadocs-ui/layouts/docs/page';
9
+import { CopyLink } from '@/components/copy-link';
10
11
const mdxComponents = getMDXComponents();
12
@@ -17,7 +18,7 @@ export default function ChangelogPage() {
18
return (
19
<DocsPage toc={[]} footer={{ enabled: false }}>
20
<DocsTitle>Changelog</DocsTitle>
20
- <DocsDescription>New updates and improvements to Composio.</DocsDescription>
21
+ <DocsDescription>Latest updates and announcements</DocsDescription>
22
<DocsBody>
23
<div className="relative">
24
{/* Timeline line */}
@@ -30,10 +31,13 @@ export default function ChangelogPage() {
31
return (
32
<article key={`${entry.date}-${entry.title}`} className="relative">
33
{/* Date column */}
33
- <div className="mb-3 md:absolute md:left-0 md:w-24 md:text-right md:pr-8">
34
- <time className="text-sm font-medium text-muted-foreground">
34
+ <div className="mb-3 md:absolute md:left-0 md:w-28 md:text-right md:pr-6">
35
+ <CopyLink
36
+ href={dateToChangelogUrl(entry.date)}
37
+ className="text-sm font-medium text-orange-500 hover:text-orange-600 transition-colors"
38
+ >
39
{formatDate(entry.date)}
36
- </time>
40
+ </CopyLink>
41
</div>
42
43
{/* Timeline dot */}
fumadocs/components/copy-link.tsx
new
+36
@@ -0,0 +1,36 @@
1
+'use client';
2
+
3
+import { useState } from 'react';
4
+import { Link, Check } from 'lucide-react';
5
+
6
+interface CopyLinkProps {
7
+ href: string;
8
+ children: React.ReactNode;
9
+ className?: string;
10
+}
11
+
12
+export function CopyLink({ href, children, className }: CopyLinkProps) {
13
+ const [copied, setCopied] = useState(false);
14
+
15
+ const handleCopy = async () => {
16
+ const fullUrl = `${window.location.origin}${href}`;
17
+ await navigator.clipboard.writeText(fullUrl);
18
+ setCopied(true);
19
+ setTimeout(() => setCopied(false), 2000);
20
+ };
21
+
22
+ return (
23
+ <button
24
+ onClick={handleCopy}
25
+ className={`inline-flex items-center gap-1.5 group cursor-pointer whitespace-nowrap ${className}`}
26
+ title="Copy link"
27
+ >
28
+ <span>{children}</span>
29
+ {copied ? (
30
+ <Check className="w-3 h-3 text-green-500" />
31
+ ) : (
32
+ <Link className="w-3 h-3 opacity-0 group-hover:opacity-70 transition-opacity" />
33
+ )}
34
+ </button>
35
+ );
36
+}
fumadocs/lib/source.ts
+20
-1
@@ -32,7 +32,26 @@ export function formatDate(dateStr: string): string {
32
// Add T12:00 to avoid UTC midnight timezone shift
33
return new Date(`${dateStr}T12:00:00`).toLocaleDateString('en-US', {
34
year: 'numeric',
35
- month: 'long',
35
+ month: 'short',
36
day: 'numeric',
37
});
38
}
39
+
40
+export function dateToChangelogUrl(dateStr: string): string {
41
+ // Convert "2025-12-29" to "/docs/changelog/2025/12/29"
42
+ const [year, month, day] = dateStr.split('-');
43
+ return `/docs/changelog/${year}/${month}/${day}`;
44
+}
45
+
46
+export function dateToSlug(dateStr: string): string[] {
47
+ // Convert "2025-12-29" to ["2025", "12", "29"]
48
+ const [year, month, day] = dateStr.split('-');
49
+ return [year, month, day];
50
+}
51
+
52
+export function slugToDate(slug: string[]): string | null {
53
+ // Convert ["2025", "12", "29"] to "2025-12-29"
54
+ if (slug.length !== 3) return null;
55
+ const [year, month, day] = slug;
56
+ return `${year}-${month}-${day}`;
57
+}