make error pages dynamic
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> + } +}