Skip to content

Open-source status page, incident response and uptime monitoring

feat: new changelog page and description (#446)

Maximilian Kaskefc68d900c975
diff --git a/apps/web/src/app/(content)/blog/page.tsx b/apps/web/src/app/(content)/blog/page.tsx
index b1d26262f..6013a6302 100644
--- a/apps/web/src/app/(content)/blog/page.tsx
+++ b/apps/web/src/app/(content)/blog/page.tsx
@@ -43,6 +43,7 @@ export default async function Post() {
publishedAt={post.publishedAt}
imageSrc={post.image}
title={post.title}
+ href={`./blog/${post.slug}`}
>
<div className="prose">
<p>{post.description}</p>
diff --git a/apps/web/src/app/(content)/changelog/[slug]/page.tsx b/apps/web/src/app/(content)/changelog/[slug]/page.tsx
new file mode 100644
index 000000000..8042316e3
--- /dev/null
+++ b/apps/web/src/app/(content)/changelog/[slug]/page.tsx
@@ -0,0 +1,81 @@
+import type { Metadata } from "next";
+import { notFound } from "next/navigation";
+import { allChangelogs } from "contentlayer/generated";
+
+import {
+ defaultMetadata,
+ ogMetadata,
+ twitterMetadata,
+} from "@/app/shared-metadata";
+import { Changelog } from "@/components/content/changelog";
+import { Shell } from "@/components/dashboard/shell";
+import { BackButton } from "@/components/layout/back-button";
+
+// export const dynamic = "force-static";
+
+export async function generateStaticParams() {
+ return allChangelogs.map((post) => ({
+ slug: post.slug,
+ }));
+}
+
+export async function generateMetadata({
+ params,
+}: {
+ params: { slug: string };
+}): Promise<Metadata | void> {
+ const post = allChangelogs.find((post) => post.slug === params.slug);
+ if (!post) {
+ return;
+ }
+
+ const { title, publishedAt: publishedTime, description, slug, image } = post;
+
+ return {
+ ...defaultMetadata,
+ title,
+ description,
+ openGraph: {
+ ...ogMetadata,
+ title,
+ description,
+ type: "article",
+ publishedTime,
+ url: `https://www.openstatus.dev/changelog/${slug}`,
+ images: [
+ {
+ url: `https://openstatus.dev/api/og/post?title=${title}&description=${description}&image=${image}`,
+ },
+ ],
+ },
+ twitter: {
+ ...twitterMetadata,
+ title,
+ description,
+ images: [
+ `https://openstatus.dev/api/og/post?title=${title}&description=${description}&image=${image}`,
+ ],
+ },
+ };
+}
+
+export default function ChangelogPage({
+ params,
+}: {
+ params: { slug: string };
+}) {
+ const post = allChangelogs.find((post) => post.slug === params.slug);
+
+ if (!post) {
+ notFound();
+ }
+
+ return (
+ <>
+ <BackButton href="/changelog" />
+ <Shell className="sm:py-8 md:py-12">
+ <Changelog post={post} />
+ </Shell>
+ </>
+ );
+}
diff --git a/apps/web/src/app/(content)/changelog/page.tsx b/apps/web/src/app/(content)/changelog/page.tsx
index 0ffce79e1..6c7fb64a5 100644
--- a/apps/web/src/app/(content)/changelog/page.tsx
+++ b/apps/web/src/app/(content)/changelog/page.tsx
@@ -1,4 +1,5 @@
import type { Metadata } from "next";
+import Link from "next/link";
import { allChangelogs } from "contentlayer/generated";
import {
@@ -40,6 +41,7 @@ export default async function Changelog() {
publishedAt={post.publishedAt}
imageSrc={post.image}
title={post.title}
+ href={`./changelog/${post.slug}`}
>
<Mdx code={post.body.code} />
</Timeline.Article>
diff --git a/apps/web/src/components/content/changelog.tsx b/apps/web/src/components/content/changelog.tsx
new file mode 100644
index 000000000..0fb041ca6
--- /dev/null
+++ b/apps/web/src/components/content/changelog.tsx
@@ -0,0 +1,35 @@
+import type { Changelog } from "contentlayer/generated";
+
+import { Mdx } from "@/components/content/mdx";
+import { formatDate } from "@/lib/utils";
+
+export function Changelog({ post }: { post: Changelog }) {
+ return (
+ <article className="grid gap-8">
+ <div className="mx-auto grid w-full max-w-prose gap-3">
+ <p className="text-muted-foreground font-mono text-sm">
+ {formatDate(new Date(post.publishedAt))}
+ </p>
+ <h1 className="font-cal mb-5 text-3xl">{post.title}</h1>
+ <div className="border-border relative h-64 w-full overflow-hidden rounded-lg border">
+ {/* <Image
+ src={post.image}
+ fill={true}
+ alt={post.title}
+ className="object-cover"
+ /> */}
+ {/* HOTFIX: plain `img` */}
+ {/* eslint-disable-next-line @next/next/no-img-element */}
+ <img
+ src={post.image}
+ alt={post.title}
+ className="h-full w-full object-cover"
+ />
+ </div>
+ </div>
+ <div className="prose-pre:overflow-y-auto prose-pre:max-w-xs md:prose-pre:max-w-none mx-auto max-w-prose">
+ <Mdx code={post.body.code} />
+ </div>
+ </article>
+ );
+}
diff --git a/apps/web/src/components/content/timeline.tsx b/apps/web/src/components/content/timeline.tsx
index 30d71f3dc..19d061914 100644
--- a/apps/web/src/components/content/timeline.tsx
+++ b/apps/web/src/components/content/timeline.tsx
@@ -1,3 +1,5 @@
+import Link from "next/link";
+
import { formatDate } from "@/lib/utils";
interface TimelineProps {
@@ -22,31 +24,40 @@ export function Timeline({ title, description, children }: TimelineProps) {
}
interface ArticleProps {
+ href: string;
publishedAt: string;
imageSrc: string;
title: string;
children?: React.ReactNode;
}
-function Article({ publishedAt, imageSrc, title, children }: ArticleProps) {
+function Article({
+ publishedAt,
+ imageSrc,
+ title,
+ children,
+ href,
+}: ArticleProps) {
return (
<article className="grid grid-cols-1 gap-4 md:grid-cols-5 md:gap-6">
<time className="text-muted-foreground order-2 font-mono text-sm md:order-1 md:col-span-1">
{formatDate(new Date(publishedAt))}
</time>
<div className="relative order-1 h-64 w-full md:order-2 md:col-span-4">
- {/* same reason as blog post - missing image on prod */}
- {/* <Image
+ <Link href={href}>
+ {/* same reason as blog post - missing image on prod */}
+ {/* <Image
src={imageSrc}
fill={true}
alt={title}
className="border-border rounded-md border object-cover"
/> */}
- <img
- src={imageSrc}
- alt={title}
- className="border-border h-64 w-full rounded-md border object-cover"
- />
+ <img
+ src={imageSrc}
+ alt={title}
+ className="border-border h-64 w-full rounded-md border object-cover"
+ />
+ </Link>
</div>
<div className="order-3 grid grid-cols-1 gap-4 md:col-span-4 md:col-start-2">
<h3 className="text-foreground font-cal text-2xl">{title}</h3>
diff --git a/apps/web/src/content/changelog/multi-region-monitoring.mdx b/apps/web/src/content/changelog/multi-region-monitoring.mdx
index c3e55e38f..7a1f7194b 100644
--- a/apps/web/src/content/changelog/multi-region-monitoring.mdx
+++ b/apps/web/src/content/changelog/multi-region-monitoring.mdx
@@ -1,11 +1,12 @@
---
title: Multi regions monitoring by default
+description: Your monitors are now being called from around the world.
publishedAt: 2023-10-25
image: /assets/changelog/multi-region-monitoring.png
---
We have migrated our backend to [fly.io](https://fly.io) and we have enabled
-multi regions monitoring by default for every monitors at no extra costs.
+multi regions monitoring by default for every monitor at no extra costs.
Here are the list of regions we are monitoring from:
diff --git a/apps/web/src/content/changelog/response-time-charts.mdx b/apps/web/src/content/changelog/response-time-charts.mdx
index 31eaf9c91..89205f3ec 100644
--- a/apps/web/src/content/changelog/response-time-charts.mdx
+++ b/apps/web/src/content/changelog/response-time-charts.mdx
@@ -1,5 +1,6 @@
---
title: Response Time Charts
+description: You have now access to new charts for better visualization.
publishedAt: 2023-10-08
image: /assets/changelog/response-time-charts.png
---
diff --git a/apps/web/src/content/changelog/slack-discord-notification.mdx b/apps/web/src/content/changelog/slack-discord-notification.mdx
index 55e1d1a63..301b49230 100644
--- a/apps/web/src/content/changelog/slack-discord-notification.mdx
+++ b/apps/web/src/content/changelog/slack-discord-notification.mdx
@@ -1,5 +1,6 @@
---
title: Slack and Discord notifications
+description: You can now send notifications to your favorite channels.
publishedAt: 2023-11-01
image: /assets/changelog/slack-discord-notification.png
---
diff --git a/apps/web/src/content/changelog/status-widget.mdx b/apps/web/src/content/changelog/status-widget.mdx
index ff5e7ca04..a7f53dd10 100644
--- a/apps/web/src/content/changelog/status-widget.mdx
+++ b/apps/web/src/content/changelog/status-widget.mdx
@@ -1,5 +1,6 @@
---
title: Status Widget
+description: You can now access the status of your status page via a public api.
publishedAt: 2023-10-05
image: /assets/changelog/status-widget.png
---
diff --git a/apps/web/src/contentlayer/documents/changelog.ts b/apps/web/src/contentlayer/documents/changelog.ts
index 4e7ab28e9..7774a57ab 100644
--- a/apps/web/src/contentlayer/documents/changelog.ts
+++ b/apps/web/src/contentlayer/documents/changelog.ts
@@ -10,6 +10,10 @@ export const Changelog = defineDocumentType(() => ({
type: "string",
required: true,
},
+ description: {
+ type: "string",
+ required: true,
+ },
image: {
type: "string",
required: true,
diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.ts
index b66d9faef..4eaa59416 100644
--- a/apps/web/src/middleware.ts
+++ b/apps/web/src/middleware.ts
@@ -73,6 +73,7 @@ export default authMiddleware({
"/blog",
"/blog/(.*)",
"/changelog",
+ "/changelog/(.*)",
"/legal/(.*)",
"/discord",
"/github",