Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(changelog): add platform-filtered changelog page routes

Richie McIlroy391c733ffab2
diff --git a/apps/web/app/(site)/changelog/[platform]/page.tsx b/apps/web/app/(site)/changelog/[platform]/page.tsx
new file mode 100644
index 000000000..331a8a71b
--- /dev/null
+++ b/apps/web/app/(site)/changelog/[platform]/page.tsx
@@ -0,0 +1,48 @@
+import type { Metadata } from "next";
+import { notFound } from "next/navigation";
+import { buildMarketingMetadata } from "@/lib/og/url";
+import { CHANGELOG_PLATFORMS, type ChangelogPlatform } from "@/utils/changelog";
+import { ChangelogView } from "../_components/ChangelogView";
+
+export const dynamicParams = false;
+
+export function generateStaticParams() {
+ return CHANGELOG_PLATFORMS.map((platform) => ({ platform }));
+}
+
+const PLATFORM_TITLES: Record<ChangelogPlatform, string> = {
+ desktop: "Desktop",
+ web: "Web",
+ mobile: "Mobile",
+ extension: "Browser Extension",
+};
+
+interface PageProps {
+ params: Promise<{ platform: string }>;
+}
+
+function resolvePlatform(value: string) {
+ return CHANGELOG_PLATFORMS.find((platform) => platform === value);
+}
+
+export async function generateMetadata(props: PageProps): Promise<Metadata> {
+ const params = await props.params;
+ const platform = resolvePlatform(params.platform);
+ if (!platform) return {};
+
+ return buildMarketingMetadata({
+ title: `${PLATFORM_TITLES[platform]} Changelog — Cap`,
+ description: `New features, improvements, and fixes in Cap for ${PLATFORM_TITLES[platform].toLowerCase()}.`,
+ path: `/changelog/${platform}`,
+ ogTitle: `Cap ${PLATFORM_TITLES[platform]} Changelog`,
+ ogTag: "Changelog",
+ });
+}
+
+export default async function Page(props: PageProps) {
+ const params = await props.params;
+ const platform = resolvePlatform(params.platform);
+ if (!platform) notFound();
+
+ return <ChangelogView platform={platform} />;
+}