about summary refs log tree commit diff stats
path: root/templates/error.templ
diff options
context:
space:
mode:
authorAlan Pearce2024-06-26 11:20:15 +0200
committerAlan Pearce2024-06-26 11:20:15 +0200
commitf8bf946b090aa4fb0b8beb4ad09c1f06078f0b5b (patch)
tree4f190e4cf9b2cba36147a6c580bfe8a7295d7bb6 /templates/error.templ
parent56ac09928f9aea7a25577e9da716afcd09d2d6b8 (diff)
downloadwebsite-f8bf946b090aa4fb0b8beb4ad09c1f06078f0b5b.tar.lz
website-f8bf946b090aa4fb0b8beb4ad09c1f06078f0b5b.tar.zst
website-f8bf946b090aa4fb0b8beb4ad09c1f06078f0b5b.zip
make error pages dynamic
Diffstat (limited to 'templates/error.templ')
-rw-r--r--templates/error.templ17
1 files changed, 17 insertions, 0 deletions
diff --git a/templates/error.templ b/templates/error.templ
new file mode 100644
index 0000000..2da7bef
--- /dev/null
+++ b/templates/error.templ
@@ -0,0 +1,17 @@
+package templates
+
+import (
+	"website/internal/config"
+	"website/internal/http"
+	"strconv"
+)
+
+templ Error(config config.Config, path string, err *http.Error) {
+	@Page(config, PageSettings{
+		Title: "Error",
+		Path:  path,
+	}) {
+		<h1>{ strconv.Itoa(err.Code) } { err.Message }</h1>
+		<h2>ʕノ•ᴥ•ʔノ ︵ ┻━┻</h2>
+	}
+}