diff --git a/internal/controller/template_controller.go b/internal/controller/template_controller.go index 7361f0d2..a01307ff 100644 --- a/internal/controller/template_controller.go +++ b/internal/controller/template_controller.go @@ -86,3 +86,10 @@ func (tc *TemplateController) UserInfo(ctx *gin.Context) { "cssPath": tc.cssPath, }) } + +func (tc *TemplateController) Page404(ctx *gin.Context) { + ctx.HTML(http.StatusOK, "404.html", gin.H{ + "scriptPath": tc.scriptPath, + "cssPath": tc.cssPath, + }) +} diff --git a/internal/router/template_router.go b/internal/router/template_router.go index 87c91d20..cd7a6f6b 100644 --- a/internal/router/template_router.go +++ b/internal/router/template_router.go @@ -35,4 +35,5 @@ func (a *TemplateRouter) RegisterTemplateRouter(r *gin.RouterGroup) { r.GET("/tags", a.templateController.TagList) r.GET("/tags/:tag", a.templateController.TagInfo) r.GET("/users/:username", a.templateController.UserInfo) + r.GET("/404", a.templateController.Page404) } diff --git a/ui/template/404.html b/ui/template/404.html index 99cda5ca..b16e4028 100644 --- a/ui/template/404.html +++ b/ui/template/404.html @@ -1,59 +1,9 @@ - - - -
- - - - - - - - -