Render empty blog template

This commit is contained in:
2021-12-03 03:09:11 +01:00
parent a04066148f
commit e853eea486
2 changed files with 17 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
package renderer
import (
"code.tokarch.uk/mainnika/nikita-tokarch-uk/frontend/content"
routing "github.com/jackwhelpton/fasthttp-routing/v2"
)
// blog handler renders blog data
func (r *Renderer) blog(c *routing.Context) (err error) {
blogContent := content.Blog{
}
return c.Write(blogContent)
}
+2
View File
@@ -5,6 +5,7 @@ import (
routing "github.com/jackwhelpton/fasthttp-routing/v2" routing "github.com/jackwhelpton/fasthttp-routing/v2"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
"code.tokarch.uk/mainnika/nikita-tokarch-uk/frontend/templates"
) )
// Renderer is the main handler that contains all routes handlers // Renderer is the main handler that contains all routes handlers
@@ -32,6 +33,7 @@ func (r *Renderer) init() {
router.Use(r.useErrorHandler) router.Use(r.useErrorHandler)
router.NotFound(r.errorNotFound) router.NotFound(r.errorNotFound)
root.Get(templates.URLBlog, r.blog)
r.router = router r.router = router
r.handler = router.HandleRequest r.handler = router.HandleRequest
} }