diff --git a/main.go b/main.go index 027f1f3..653b4c3 100644 --- a/main.go +++ b/main.go @@ -91,6 +91,8 @@ func registerRoutes(r *gin.Engine) { models.DB.Select("*").Offset(offset).Limit(pager.PageSize).Find(&items, "type = ?", "post") c.HTML(http.StatusOK, "index.tmpl", gin.H{ "Items": items, + "Pager": pager, + "Title": "文章列表", }) }) r.GET("/createcontent", func(c *gin.Context) { diff --git a/templates/index.tmpl b/templates/index.tmpl index 46586b8..a3e6e98 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -1,18 +1,28 @@ - My Blog + {{ .Title}}