Skip to content

Open-source status page, incident response and uptime monitoring

feat: seo for status page (#86)

Thibault Le Ouayc79ea9295b48
diff --git a/apps/web/src/app/status-page/[domain]/page.tsx b/apps/web/src/app/status-page/[domain]/page.tsx
index 146ecfe90..3f47ba561 100644
--- a/apps/web/src/app/status-page/[domain]/page.tsx
+++ b/apps/web/src/app/status-page/[domain]/page.tsx
@@ -1,3 +1,4 @@
+import type { Metadata } from "next";
import { notFound } from "next/navigation";
import { Header } from "@/components/dashboard/header";
@@ -5,7 +6,12 @@ import { Shell } from "@/components/dashboard/shell";
import { MonitorList } from "@/components/status-page/monitor-list";
import { api } from "@/trpc/server";
-export default async function Page({ params }: { params: { domain: string } }) {
+type Props = {
+ params: { domain: string };
+ searchParams: { [key: string]: string | string[] | undefined };
+};
+
+export default async function Page({ params }: Props) {
// We should fetch the the monitors and incident here
// also the page information
if (!params.domain) return notFound();
@@ -27,3 +33,20 @@ export default async function Page({ params }: { params: { domain: string } }) {
</Shell>
);
}
+
+export async function generateMetadata({ params }: Props): Promise<Metadata> {
+ const page = await api.page.getPageBySlug.query({ slug: params.domain });
+
+ return {
+ title: page?.title,
+ description: page?.description,
+ twitter: {
+ title: page?.title,
+ description: page?.description,
+ },
+ openGraph: {
+ title: page?.title,
+ description: page?.description,
+ },
+ };
+}