update
This commit is contained in:
+17
-3
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user