Render empty blog template

pull/1/head
Nikita Tokarchuk 3 years ago
parent a04066148f
commit e853eea486
Signed by: mainnika
GPG Key ID: A595FB7E3E56911C
  1. 15
      frontend/renderer/blog.go
  2. 2
      frontend/renderer/renderer.go

@ -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)
}

@ -5,6 +5,7 @@ import (
routing "github.com/jackwhelpton/fasthttp-routing/v2"
"github.com/valyala/fasthttp"
"code.tokarch.uk/mainnika/nikita-tokarch-uk/frontend/templates"
)
// Renderer is the main handler that contains all routes handlers
@ -32,6 +33,7 @@ func (r *Renderer) init() {
router.Use(r.useErrorHandler)
router.NotFound(r.errorNotFound)
root.Get(templates.URLBlog, r.blog)
r.router = router
r.handler = router.HandleRequest
}

Loading…
Cancel
Save