mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-15 02:42:27 +08:00
fix out of range about MapArticles
This commit is contained in:
4
front.go
4
front.go
@@ -119,11 +119,11 @@ func HandleArchivesPage(c *gin.Context) {
|
||||
|
||||
func HandleArticlePage(c *gin.Context) {
|
||||
path := c.Param("slug")
|
||||
artc := Ei.MapArticles[path[0:strings.Index(path, ".")]]
|
||||
if artc == nil {
|
||||
if !strings.HasSuffix(path, ".html") || Ei.MapArticles[path[:len(path)-5]] == nil {
|
||||
HandleNotFound(c)
|
||||
return
|
||||
}
|
||||
artc := Ei.MapArticles[path[:len(path)-5]]
|
||||
h := GetBase()
|
||||
h["Version"] = StaticVersion(c)
|
||||
h["Title"] = artc.Title + " | " + Ei.BTitle
|
||||
|
||||
Reference in New Issue
Block a user