Skip to content

Commit 9b841ea

Browse files
committed
feat: add sitemap
1 parent d640c5f commit 9b841ea

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

src/app/not-found.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import type { Metadata } from "next";
2+
3+
export const metadata: Metadata = {
4+
title: "Page Not Found",
5+
description: "The page you're looking for doesn't exist.",
6+
robots: { index: false },
7+
};
8+
9+
export default function NotFound() {
10+
return (
11+
<div className="layout-container flex min-h-screen flex-col items-center justify-center gap-8 px-4 py-16 text-center">
12+
<div className="flex flex-col gap-4">
13+
<h1 className="font-bold text-9xl">404</h1>
14+
<div className="h-1 w-full rounded-full bg-gradient-to-r from-transparent via-white/25 to-transparent" />
15+
</div>
16+
17+
<div className="flex flex-col gap-3">
18+
<h2 className="font-bold text-3xl">Page Not Found</h2>
19+
<p className="text-lg opacity-50">Looks like you got lost... how peculiar</p>
20+
</div>
21+
</div>
22+
);
23+
}

src/app/robots.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type { MetadataRoute } from "next";
2+
3+
export default function robots(): MetadataRoute.Robots {
4+
return {
5+
rules: {
6+
userAgent: "*",
7+
},
8+
sitemap: "https://koding.dev/sitemap.xml",
9+
};
10+
}

src/app/sitemap.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import type { MetadataRoute } from "next";
2+
import { allArtists, allClients } from "@/lib/content";
3+
4+
const BASE_URL = "https://koding.dev";
5+
6+
export default function sitemap(): MetadataRoute.Sitemap {
7+
return [
8+
// Home
9+
{
10+
changeFrequency: "monthly",
11+
priority: 1,
12+
url: BASE_URL,
13+
},
14+
// Clients
15+
{
16+
changeFrequency: "monthly",
17+
priority: 0.8,
18+
url: `${BASE_URL}/clients`,
19+
},
20+
...allClients.map(
21+
(client) =>
22+
({
23+
changeFrequency: "monthly",
24+
priority: 0.7,
25+
url: `${BASE_URL}/clients/${client.slug}`,
26+
}) satisfies MetadataRoute.Sitemap[0]
27+
),
28+
// Art
29+
{
30+
changeFrequency: "monthly",
31+
priority: 0.6,
32+
url: `${BASE_URL}/art`,
33+
},
34+
...allArtists.flatMap((artist) =>
35+
artist.commissions.map(
36+
(commission) =>
37+
({
38+
changeFrequency: "monthly",
39+
priority: 0.5,
40+
url: `${BASE_URL}/art/${artist.slug}/${commission.slug}`,
41+
}) satisfies MetadataRoute.Sitemap[0]
42+
)
43+
),
44+
];
45+
}

0 commit comments

Comments
 (0)