Skip to content

Commit 386ba65

Browse files
Render markdown release notes on download page
The download page now uses the shared `ReleaseBody` component instead of a raw `<pre>` block, so release notes render as formatted Markdown. `ReleaseBody` was enhanced to strip an extra `## DevStackBox...` heading, accept a `className` override, and apply a bordered/padded container style. Global release-note styles were also expanded to cover inline code, horizontal rules, and links for more consistent readability.
1 parent 3afba97 commit 386ba65

3 files changed

Lines changed: 24 additions & 5 deletions

File tree

app/download/page.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Metadata } from "next";
22
import Link from "next/link";
33
import { Download, ExternalLink } from "lucide-react";
4+
import { ReleaseBody } from "@/components/release-body";
45
import { homepage } from "@/content/homepage";
56
import {
67
findWindowsInstaller,
@@ -65,9 +66,7 @@ export default async function DownloadPage() {
6566
{release?.body ? (
6667
<section className="mt-10">
6768
<h2 className="text-lg font-semibold">Release notes</h2>
68-
<pre className="mt-4 whitespace-pre-wrap rounded-lg border border-border bg-muted/30 p-4 text-sm text-muted-foreground">
69-
{release.body.slice(0, 2000)}
70-
</pre>
69+
<ReleaseBody body={release.body} className="mt-4" />
7170
</section>
7271
) : null}
7372

app/globals.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,18 @@
184184
.release-body strong {
185185
@apply font-semibold text-foreground;
186186
}
187+
188+
.release-body code {
189+
@apply rounded bg-muted px-1 py-0.5 font-mono text-xs text-foreground;
190+
}
191+
192+
.release-body hr {
193+
@apply my-4 border-border;
194+
}
195+
196+
.release-body a {
197+
@apply text-primary underline-offset-4 hover:underline;
198+
}
187199
}
188200

189201
.text-hero {

components/release-body.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
import ReactMarkdown from "react-markdown";
22
import remarkGfm from "remark-gfm";
3+
import { cn } from "@/lib/utils";
34

45
function prepareReleaseBody(body: string): string {
56
let text = body.trim();
67
text = text.replace(/^#\s+.+\n+/, "");
8+
text = text.replace(/^##\s+DevStackBox[^\n]*\n+/i, "");
79
text = text.replace(/^\*\*[^*\n]+\*\*\s*\n+/, "");
810
return text.trim();
911
}
1012

1113
type ReleaseBodyProps = {
1214
body: string;
15+
className?: string;
1316
};
1417

15-
export function ReleaseBody({ body }: ReleaseBodyProps) {
18+
export function ReleaseBody({ body, className }: ReleaseBodyProps) {
1619
const markdown = prepareReleaseBody(body);
1720
if (!markdown) return null;
1821

1922
return (
20-
<div className="release-body doc-content prose-no-margin mt-3 text-sm text-muted-foreground">
23+
<div
24+
className={cn(
25+
"release-body doc-content prose-no-margin rounded-lg border border-border bg-muted/20 p-6 text-sm text-muted-foreground",
26+
className,
27+
)}
28+
>
2129
<ReactMarkdown remarkPlugins={[remarkGfm]}>{markdown}</ReactMarkdown>
2230
</div>
2331
);

0 commit comments

Comments
 (0)