From 08022679899d972544708d4de3e28a3935d84359 Mon Sep 17 00:00:00 2001 From: zhangchao Date: Tue, 26 Nov 2024 18:41:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 2 ++ templates/index.tmpl | 39 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) 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}}