mirror of
https://github.com/JustKato/FreePad.git
synced 2026-02-23 15:50:46 +02:00
* Basics realized
This commit is contained in:
28
lib/routes/routes_home.go
Normal file
28
lib/routes/routes_home.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"github.com/JustKato/FreePad/lib/helper"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func HomeRoutes(router *gin.Engine) {
|
||||
|
||||
router.GET("/", func(c *gin.Context) {
|
||||
c.HTML(200, "index.html", gin.H{
|
||||
"title": "HomePage",
|
||||
"domain_base": helper.GetDomainBase(),
|
||||
})
|
||||
})
|
||||
|
||||
router.GET("/:post", func(c *gin.Context) {
|
||||
// Get the post we are looking for.
|
||||
postName := c.Param("post")
|
||||
|
||||
c.HTML(200, "page.html", gin.H{
|
||||
"title": postName,
|
||||
"post_content": "",
|
||||
"domain_base": helper.GetDomainBase(),
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user