mirror of
https://github.com/mainnika/nikita-tokarch-uk.git
synced 2026-05-25 01:03:35 +00:00
Render empty index 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// index handler renders index data
|
||||||
|
func (r *Renderer) index(c *routing.Context) (err error) {
|
||||||
|
|
||||||
|
indexContent := content.Index{
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.Write(indexContent)
|
||||||
|
}
|
||||||
@@ -33,7 +33,10 @@ func (r *Renderer) init() {
|
|||||||
router.Use(r.useErrorHandler)
|
router.Use(r.useErrorHandler)
|
||||||
router.NotFound(r.errorNotFound)
|
router.NotFound(r.errorNotFound)
|
||||||
|
|
||||||
|
root := router.Group(r.Base)
|
||||||
|
root.Get(templates.URLIndex, r.index)
|
||||||
root.Get(templates.URLBlog, r.blog)
|
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