new: Added friends page and adjust page style

This commit is contained in:
2024-12-19 15:21:36 +08:00
parent 4491e806e0
commit 2fa6e78626
16 changed files with 240 additions and 148 deletions

View File

@@ -496,3 +496,21 @@ func (ma *MApp) RSSHandler(ctx *gin.Context) {
ctx.String(http.StatusNotFound, "RSS Not Found")
}
}
func (ma *MApp) FriendHandler(ctx *gin.Context) {
resData := gin.H{
"site_info": gin.H{
"logo": ma.Config.MSite.Info.Logo,
"title": ma.Config.MSite.Info.Title,
"author": ma.Config.MSite.Info.Author,
"language": ma.Config.MSite.Info.Language,
"copyright": template.HTML(ma.Config.MSite.Info.Copyright),
},
"menu": ma.Config.MSite.Menu,
"friend": gin.H{
"title": ma.Config.MSite.Friend.Title,
"list": ma.Config.MSite.Friend.List,
},
}
ctx.HTML(http.StatusOK, "friend.html", resData)
}

View File

@@ -7,6 +7,7 @@ func (ma *MApp) loadRoutes() {
ma.engine.GET("/rss", ma.RSSHandler)
ma.engine.GET("/about", ma.AboutHandler)
ma.engine.GET("/search", ma.SearchHandler)
ma.engine.GET("/friend", ma.FriendHandler)
ma.engine.GET("/archive", ma.ArchiveHandler)
ma.engine.GET("/post/:hash", ma.PostHandler)
ma.engine.GET("/tag/:hash", ma.TagHandler)