From f8bf946b090aa4fb0b8beb4ad09c1f06078f0b5b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 26 Jun 2024 11:20:15 +0200 Subject: make error pages dynamic --- templates/error.templ | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 templates/error.templ (limited to 'templates/error.templ') 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, + }) { +

{ strconv.Itoa(err.Code) } { err.Message }

+

ʕノ•ᴥ•ʔノ ︵ ┻━┻

+ } +} -- cgit 1.4.1