Skip to content

Commit a464f5d

Browse files
authored
Merge pull request #429 from code-hike/next
Better not-found
2 parents ce8b69d + 37ad87f commit a464f5d

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

apps/web/app/blog/feed.xml/route.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ export async function GET() {
1010
title: "Code Hike",
1111
description: "Markdown, React and everything in between.",
1212
generator: "RSS for Node and Next.js",
13-
feed_url: "https://v1.codehike.org/blog/feed.xml",
14-
site_url: "https://v1.codehike.org/blog",
13+
feed_url: "https://codehike.org/blog/feed.xml",
14+
site_url: "https://codehike.org/blog",
1515
language: "en-US",
1616
pubDate: new Date().toUTCString(),
1717
ttl: 120,
18-
image_url: "https://v1.codehike.org/logo.png",
18+
image_url: "https://codehike.org/logo.png",
1919
})
2020

2121
posts.map(({ data, url }) => {
2222
feed.item({
2323
title: data.title,
2424
description: data.description || "",
25-
url: `https://v1.codehike.org${url}`,
25+
url: `https://codehike.org${url}`,
2626
author: data.authors[0],
2727
date: data.date,
2828
})

apps/web/app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const metadata: Metadata = {
2929
title: "Code Hike",
3030
description:
3131
"Use Markdown and React to build rich content websites. Documentation, tutorials, blogs, videos, interactive walkthroughs, and more.",
32-
metadataBase: new URL("https://v1.codehike.org"),
32+
metadataBase: new URL("https://codehike.org"),
3333
openGraph: {
3434
title: "Code Hike",
3535
images: `/codehike.png`,
@@ -43,7 +43,7 @@ export const metadata: Metadata = {
4343
},
4444
alternates: {
4545
types: {
46-
"application/rss+xml": "https://v1.codehike.org/blog/feed.xml",
46+
"application/rss+xml": "https://codehike.org/blog/feed.xml",
4747
},
4848
},
4949
}

apps/web/app/not-found.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1+
"use client"
2+
import { usePathname } from "next/navigation"
3+
14
export default function NotFound() {
5+
const pathname = usePathname()
6+
const v0url = "v0.codehike.org" + pathname
27
return (
3-
<h2 className="w-full h-[80vh] flex justify-center items-center text-6xl">
4-
404
5-
</h2>
8+
<main className="w-full h-[80vh] flex flex-col gap-2 justify-center items-center">
9+
<h2 className="text-6xl mb-8">Page not found.</h2>
10+
<p>
11+
For older versions try:{" "}
12+
<a href={"https://" + v0url} className="text-primary underline">
13+
{v0url}
14+
</a>
15+
</p>
16+
</main>
617
)
718
}

0 commit comments

Comments
 (0)