diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/404.templ | 13 | ||||
-rw-r--r-- | templates/error.templ | 17 |
2 files changed, 17 insertions, 13 deletions
diff --git a/templates/404.templ b/templates/404.templ deleted file mode 100644 index 4b5e52a..0000000 --- a/templates/404.templ +++ /dev/null @@ -1,13 +0,0 @@ -package templates - -import "website/internal/config" - -templ NotFound(config config.Config, path string) { - @Page(config, PageSettings{ - Title: "Not Found", - Path: path, - }) { - <h1>404</h1> - <h2>ʕノ•ᴥ•ʔノ ︵ ┻━┻</h2> - } -} 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> + } +} |