all repos — homestead @ 2f18365a37f761bd86bda6e3ee0bd003cb4b1f02

Code for my website

make error pages dynamic

Alan Pearce
commit

2f18365a37f761bd86bda6e3ee0bd003cb4b1f02

parent

7a4791a67e14f7cfddd19dcb9454b509d9fd2149

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> + } +}