mirror of
https://github.com/mainnika/nikita-tokarch-uk.git
synced 2026-05-25 01:03:35 +00:00
Render empty blog template
This commit is contained in:
@@ -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"
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user