Skip to content

Commit d0c854b

Browse files
Alex KrawiecAlex Krawiec
authored andcommitted
Add docs changelog
1 parent a202ca4 commit d0c854b

File tree

3 files changed

+171
-0
lines changed

3 files changed

+171
-0
lines changed

docs/changelog.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: Documentation Changelog
3+
sidebar_order: 100
4+
description: Track recent updates to Sentry documentation with AI-generated summaries
5+
---
6+
7+
import {DocsChangelog} from 'sentry-docs/components/changelog/docsChangelog';
8+
9+
# Documentation Changelog
10+
11+
Stay up-to-date with the latest changes to Sentry's documentation. This page automatically tracks all updates with AI-generated summaries that explain what changed and why it matters.
12+
13+
## Recent Updates
14+
15+
<DocsChangelog />
16+
17+
## Alternative Views
18+
19+
- [Full Content Dashboard](https://sentry-content-dashboard.sentry.dev/) - View all Sentry content (blog, videos, docs, changelog)
20+
- [RSS Feed](https://sentry-content-dashboard.sentry.dev/api/docs/feed) - Subscribe to doc updates in your RSS reader
21+
- [JSON API](https://sentry-content-dashboard.sentry.dev/api/docs) - Programmatically access changelog data
22+
23+
<Alert level="info">
24+
The changelog updates automatically throughout the day. Summaries are generated by AI to provide quick, user-friendly insights into each update from the [getsentry/sentry-docs](https://github.com/getsentry/sentry-docs) repository.
25+
</Alert>
26+
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
interface ChangelogEntry {
2+
id: string;
3+
title: string;
4+
description: string;
5+
url: string;
6+
publishedAt: string;
7+
author: string;
8+
filesChanged?: {
9+
added: string[];
10+
modified: string[];
11+
removed: string[];
12+
};
13+
}
14+
15+
async function getChangelogEntries(): Promise<ChangelogEntry[]> {
16+
try {
17+
const res = await fetch('https://sentry-content-dashboard.sentry.dev/api/docs', {
18+
next: { revalidate: 3600 }, // Cache for 1 hour
19+
});
20+
21+
if (!res.ok) {
22+
throw new Error('Failed to fetch changelog');
23+
}
24+
25+
return res.json();
26+
} catch (error) {
27+
console.error('Error fetching changelog:', error);
28+
return [];
29+
}
30+
}
31+
32+
export async function DocsChangelog() {
33+
const entries = await getChangelogEntries();
34+
35+
if (entries.length === 0) {
36+
return (
37+
<div className="rounded-lg border border-yellow-200 bg-yellow-50 p-4 text-yellow-800">
38+
<p className="font-semibold">No changelog entries available</p>
39+
<p className="text-sm">Check back later for updates.</p>
40+
</div>
41+
);
42+
}
43+
44+
return (
45+
<div className="space-y-8">
46+
{entries.map(entry => {
47+
const date = new Date(entry.publishedAt);
48+
const totalFiles =
49+
(entry.filesChanged?.added.length || 0) +
50+
(entry.filesChanged?.modified.length || 0) +
51+
(entry.filesChanged?.removed.length || 0);
52+
53+
return (
54+
<article
55+
key={entry.id}
56+
className="border-b border-gray-200 pb-8 last:border-0"
57+
>
58+
<header className="mb-3">
59+
<h3 className="mb-2 text-xl font-semibold">
60+
<a
61+
href={entry.url}
62+
target="_blank"
63+
rel="noopener noreferrer"
64+
className="text-primary hover:underline"
65+
>
66+
{entry.title.replace('Docs Update: ', '')}
67+
</a>
68+
</h3>
69+
<div className="flex flex-wrap items-center gap-3 text-sm text-gray-600">
70+
<time dateTime={entry.publishedAt}>
71+
{date.toLocaleDateString('en-US', {
72+
year: 'numeric',
73+
month: 'long',
74+
day: 'numeric',
75+
})}
76+
</time>
77+
<span></span>
78+
<span>by {entry.author}</span>
79+
{totalFiles > 0 && (
80+
<>
81+
<span></span>
82+
<span>{totalFiles} file{totalFiles !== 1 ? 's' : ''} changed</span>
83+
</>
84+
)}
85+
</div>
86+
</header>
87+
88+
<p className="mb-4 text-gray-700">{entry.description}</p>
89+
90+
{entry.filesChanged && totalFiles > 0 && (
91+
<details className="text-sm">
92+
<summary className="cursor-pointer text-gray-600 hover:text-gray-800">
93+
View changed files
94+
</summary>
95+
<div className="mt-2 space-y-2 rounded-md bg-gray-50 p-3">
96+
{entry.filesChanged.added.length > 0 && (
97+
<div>
98+
<span className="font-semibold text-green-700">Added:</span>
99+
<ul className="ml-4 mt-1 list-inside list-disc">
100+
{entry.filesChanged.added.map(file => (
101+
<li key={file} className="text-gray-700">
102+
{file}
103+
</li>
104+
))}
105+
</ul>
106+
</div>
107+
)}
108+
{entry.filesChanged.modified.length > 0 && (
109+
<div>
110+
<span className="font-semibold text-blue-700">Modified:</span>
111+
<ul className="ml-4 mt-1 list-inside list-disc">
112+
{entry.filesChanged.modified.map(file => (
113+
<li key={file} className="text-gray-700">
114+
{file}
115+
</li>
116+
))}
117+
</ul>
118+
</div>
119+
)}
120+
{entry.filesChanged.removed.length > 0 && (
121+
<div>
122+
<span className="font-semibold text-red-700">Removed:</span>
123+
<ul className="ml-4 mt-1 list-inside list-disc">
124+
{entry.filesChanged.removed.map(file => (
125+
<li key={file} className="text-gray-700">
126+
{file}
127+
</li>
128+
))}
129+
</ul>
130+
</div>
131+
)}
132+
</div>
133+
</details>
134+
)}
135+
</article>
136+
);
137+
})}
138+
</div>
139+
);
140+
}
141+

src/components/sidebar/sidebarNavigation.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ const productSidebarItems = [
4444
title: 'Concepts & Reference',
4545
root: 'concepts',
4646
},
47+
{
48+
title: 'Documentation Changelog',
49+
root: 'changelog',
50+
},
4751
];
4852

4953
export async function SidebarNavigation({path}: {path: string[]}) {

0 commit comments

Comments
 (0)