From a949879330fcc47b6393d32bef66f0d23cad99e1 Mon Sep 17 00:00:00 2001 From: Korbs Date: Fri, 21 Jun 2024 21:32:51 -0400 Subject: [PATCH] Custom error pages --- src/layouts/Error.astro | 57 +++++++++++++++++++++++++++++++++++++++++ src/pages/404.astro | 5 ++++ src/pages/500.astro | 10 ++++++++ 3 files changed, 72 insertions(+) create mode 100644 src/layouts/Error.astro create mode 100644 src/pages/404.astro create mode 100644 src/pages/500.astro diff --git a/src/layouts/Error.astro b/src/layouts/Error.astro new file mode 100644 index 0000000..aac120a --- /dev/null +++ b/src/layouts/Error.astro @@ -0,0 +1,57 @@ +--- +// Properties +const { ErrorMessage } = Astro.props + +// i18n +import i18next, { t } from "i18next"; +import { Trans, HeadHrefLangs } from "astro-i18next/components"; +--- + + + + Poke + + + + + +
+

An error occured

+

{ErrorMessage}

+
+ + + + \ No newline at end of file diff --git a/src/pages/404.astro b/src/pages/404.astro new file mode 100644 index 0000000..b28a12f --- /dev/null +++ b/src/pages/404.astro @@ -0,0 +1,5 @@ +--- +import ErrorLayout from "@layouts/Error.astro"; +--- + + \ No newline at end of file diff --git a/src/pages/500.astro b/src/pages/500.astro new file mode 100644 index 0000000..be90521 --- /dev/null +++ b/src/pages/500.astro @@ -0,0 +1,10 @@ +--- +import ErrorLayout from "@layouts/Error.astro"; + +interface Props { + error: unknown; +} +const { error } = Astro.props; +--- + + \ No newline at end of file