Skip to content

Commit bdb9d7b

Browse files
committed
feat(site): basic 404 and 500 pages
progress against #508
1 parent 0197a30 commit bdb9d7b

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

site/src/layouts/ErrorPage.astro

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
import Footer from '@/components/Footer.astro';
3+
import FooterEasterEgg from '@/components/FooterEasterEgg.astro';
4+
import GetStartedLink from '@/components/NavBar/GetStartedLink';
5+
import NavBar from '@/components/NavBar/NavBar.astro';
6+
import Base from '@/layouts/Base.astro';
7+
8+
interface Props {
9+
title: string;
10+
description: string;
11+
heading: string;
12+
}
13+
14+
const { title, description, heading } = Astro.props;
15+
---
16+
17+
<Base {title} {description}>
18+
<div class="min-h-screen flex flex-col">
19+
<NavBar />
20+
<main class="flex-1 px-6 md:px-10 py-10 sm:py-14 flex items-center justify-center">
21+
<div class="text-center flex flex-col items-center gap-4">
22+
<h1 class="text-h2 md:text-h1">{heading}</h1>
23+
<div class="text-lg flex flex-col items-center gap-2">
24+
<a href="/" class="intent:underline">Go home</a>
25+
<GetStartedLink client:idle className="intent:underline">Read the docs</GetStartedLink>
26+
</div>
27+
</div>
28+
</main>
29+
<Footer />
30+
</div>
31+
<FooterEasterEgg />
32+
</Base>

site/src/pages/404.astro

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
import ErrorPage from '@/layouts/ErrorPage.astro';
3+
---
4+
5+
<ErrorPage title="404" description="Page not found" heading="404 Not Found" />

site/src/pages/500.astro

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
import ErrorPage from '@/layouts/ErrorPage.astro';
3+
---
4+
5+
<ErrorPage title="500" description="Server error" heading="500 Server Error" />

0 commit comments

Comments
 (0)