-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added custom error page so GH pages doesn't fallback
- Loading branch information
Showing
3 changed files
with
42 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<script> | ||
import { page } from "$app/stores"; | ||
import Waves from "$lib/components/Waves.svelte"; | ||
let heading = $page.status === 404 ? "404" : "Error"; | ||
let errorMessage = | ||
$page.error && $page.error.message.includes("Error: ") | ||
? "An unknown error occurred" | ||
: $page.error?.message; | ||
let notFoundMessage = | ||
$page.error?.message === "Not Found" ? "Page not found" : $page.error?.message; | ||
</script> | ||
<div | ||
class="flex flex-col min-h-full h-full flex-grow justify-center items-center text-2xl overflow-hidden" | ||
> | ||
<div | ||
class="flex flex-col bg-gradient-to-b from-primary to-accentLight justify-between items-center" | ||
> | ||
<div class="text-center space-y-2 items-center justify-center h-full mt-64"> | ||
<h1 class="text-5xl lg:text-9xl font-black">{heading}</h1> | ||
<p class="text-2xl lg:text-4xl text-muted-foreground"> | ||
{$page.status === 404 ? notFoundMessage : errorMessage} | ||
</p> | ||
</div> | ||
<Waves /> | ||
<div class="bg-accent h-64 w-full"></div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
<script> | ||
import '../app.pcss'; | ||
import Footer from '$lib/sections/Footer.svelte'; | ||
import Header from '$lib/sections/Header.svelte'; | ||
import "../app.pcss"; | ||
import Footer from "$lib/sections/Footer.svelte"; | ||
import Header from "$lib/sections/Header.svelte"; | ||
</script> | ||
|
||
<Header /> | ||
<slot /> | ||
<Footer /> | ||
<div class="flex flex-col min-h-screen"> | ||
<Header /> | ||
<main class="flex-grow bg-accent"> | ||
<slot /> | ||
</main> | ||
<Footer /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters