all repos — website @ f8bf946b090aa4fb0b8beb4ad09c1f06078f0b5b

My website

make error pages dynamic

Alan Pearce
commit

f8bf946b090aa4fb0b8beb4ad09c1f06078f0b5b

parent

56ac09928f9aea7a25577e9da716afcd09d2d6b8

1 file changed, 17 insertions(+), 0 deletions(-)

changed files
A 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> + } +}