Skip to content

Commit 3af0637

Browse files
committed
feat: add changelog system
This implements a new changelog system to the docs so it's easy to browse it and subscribe via RSS. Fixes MRGFY-5981 Change-Id: Ia2551cf70a6317a02376c287da41230680a05be4
1 parent 647a53a commit 3af0637

File tree

149 files changed

+3357
-2255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+3357
-2255
lines changed

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default [
1616
'node_modules/**',
1717
'.github/**',
1818
'public/scalar-api-reference.js',
19+
'src/content/changelog/',
1920
],
2021
},
2122

package-lock.json

Lines changed: 996 additions & 2241 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"dependencies": {
6666
"@astrojs/check": "^0.9.5",
6767
"@astrojs/react": "^4.4.0",
68+
"@astrojs/rss": "^4.0.12",
6869
"@astrojs/vue": "^5.1.1",
6970
"@fontsource/ibm-plex-mono": "^5.2.7",
7071
"@fontsource/poppins": "^5.2.7",

src/@types/changelog-content.d.ts

Whitespace-only changes.

src/components/Breadcrumbs.astro

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ for (const [p, t] of trails.entries()) {
4040
}
4141
}
4242
43+
// Handle dynamic changelog entries
44+
if (currentPath.startsWith('/changelog/') && currentPath !== '/changelog') {
45+
// This is a specific changelog entry page
46+
matchedTrail = [{ title: 'Changelog', path: '/changelog' }];
47+
48+
// Add the current page title from props if available
49+
const { breadcrumbTitle } = Astro.props as { breadcrumbTitle?: string };
50+
if (breadcrumbTitle) {
51+
matchedTrail.push({ title: breadcrumbTitle });
52+
}
53+
}
54+
4355
if (matchedTrail.length >= 2) {
4456
const filtered: TrailEntry[] = [];
4557
for (const entry of matchedTrail) {

src/components/Button.astro

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,20 @@ export interface Props {
2323
href?: string;
2424
icon: Function;
2525
variant?: 'ghost' | 'solid';
26+
target?: string;
2627
}
27-
const { colorScheme, style, href, icon, variant = 'solid' } = Astro.props as Props;
28+
const {
29+
colorScheme,
30+
style,
31+
href,
32+
icon,
33+
variant = 'solid',
34+
target = '_blank',
35+
} = Astro.props as Props;
2836
---
2937

3038
<div role="presentation" class:list={['button', `button-${colorScheme}`, variant]} {style}>
31-
<a href={href} target="_blank">
39+
<a href={href} target={target}>
3240
{icon && <Astro.props.icon />}
3341
<slot />
3442
</a>

src/components/Footer/footer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const helpCategory: Category = {
8484
},
8585
{
8686
text: 'Changelog',
87-
href: 'https://changelog.mergify.com/',
87+
href: 'https://docs.mergify.com/changelog/',
8888
},
8989
{
9090
text: 'Terms of Service',

src/components/Header/Header.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ import ThemeToggleButton from './ThemeToggleButton';
8787
<HeaderLink href="https://slack.mergify.com" icon={SiSlack}>Slack Community</HeaderLink>
8888
<HeaderLink href="https://github.com/Mergifyio/mergify/discussions" icon={FaGithub}>
8989
Discussions
90-
</HeaderLink>
91-
<HeaderLink href="https://changelog.mergify.com" icon={HiOutlineDocumentArrowUp}>
90+
</HeaderLink>
91+
<HeaderLink href="/changelog/" icon={HiOutlineDocumentArrowUp} target="_self">
9292
Changelog
9393
</HeaderLink>
9494
<HeaderLink href="https://status.mergify.com" icon={SiStatuspage}>Status</HeaderLink>

src/components/Header/HeaderLink.astro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import Button from '../Button.astro';
44
export interface Props {
55
icon: Function;
66
href: string;
7+
target?: string;
78
}
89
9-
const { href, icon } = Astro.props as Props;
10+
const { href, icon, target } = Astro.props as Props;
1011
---
1112

1213
<div class="header-btn">
13-
<Button colorScheme="blue" variant="ghost" icon={icon} href={href}>
14+
<Button colorScheme="blue" variant="ghost" icon={icon} href={href} target={target}>
1415
<slot />
1516
</Button>
1617
</div>

src/content.config.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineCollection, z } from 'astro:content';
33
import { glob } from 'astro/loaders';
44

55
const docs = defineCollection({
6-
/* ... */
6+
/* Documentation pages */
77
loader: glob({
88
pattern: '**/[^_]*.mdx',
99
base: './src/content/docs',
@@ -16,4 +16,14 @@ const docs = defineCollection({
1616
}),
1717
});
1818

19-
export const collections = { docs };
19+
const changelog = defineCollection({
20+
type: 'content',
21+
schema: z.object({
22+
title: z.string(),
23+
date: z.date(),
24+
description: z.string().optional(),
25+
tags: z.array(z.string()).default([]),
26+
}),
27+
});
28+
29+
export const collections = { docs, changelog };

0 commit comments

Comments
 (0)