This commit is contained in:
2023-03-10 14:11:45 +08:00
parent eff40107b2
commit d6d708bf5d
7 changed files with 27 additions and 13 deletions
+17 -3
View File
@@ -38,9 +38,23 @@ func Index(c *gin.Context) {
list = append(list, article)
}
}
nextPage := 0
if start+limit < total {
nextPage = p + 1
}
prevPage := 1
if p > 2 {
prevPage = p + 1
}
c.HTML(200, "index.html", gin.H{
"list": list,
"total": total,
"title": "Home",
"list": list,
"total": total,
"title": "Home",
"page": p,
"nextPage": nextPage,
"prevPage": prevPage,
})
}