mirror of
https://github.com/eiblog/eiblog.git
synced 2026-03-01 00:34:58 +08:00
fix out of range about MapArticles
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
### 提醒
|
### 郑重提醒
|
||||||
标题、slug、内容。在你点击保存的时候一定确保三者不能为空,否则页面刷新内容就没了。所以,养成一个良好的写作习惯很重要。
|
**标题**、**slug**、**内容**。在你点击保存的时候一定确保三者不能为空,否则页面刷新内容就没了。所以,养成一个良好的写作习惯很重要。
|
||||||
|
|
||||||
当然,博客的自动保存功能也非常的好。在你不确定是否发布前,你可以将之保存到草稿,以便下次继续编辑。
|
当然,博客的自动保存功能也非常的好。在你不确定是否发布前,你可以将之保存到草稿,以便下次继续编辑。
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
x 为小写字母(x,y,z)中的 x。使页面未加载时也占了相应的位置大小,这样设计是为了让读者在浏览页面时不会感到抖动。
|
x 为小写字母(x,y,z)中的 x。使页面未加载时也占了相应的位置大小,这样设计是为了让读者在浏览页面时不会感到抖动。
|
||||||
|
|
||||||
如:
|
如:
|
||||||
|
```
|
||||||

|

|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
4
front.go
4
front.go
@@ -119,11 +119,11 @@ func HandleArchivesPage(c *gin.Context) {
|
|||||||
|
|
||||||
func HandleArticlePage(c *gin.Context) {
|
func HandleArticlePage(c *gin.Context) {
|
||||||
path := c.Param("slug")
|
path := c.Param("slug")
|
||||||
artc := Ei.MapArticles[path[0:strings.Index(path, ".")]]
|
if !strings.HasSuffix(path, ".html") || Ei.MapArticles[path[:len(path)-5]] == nil {
|
||||||
if artc == nil {
|
|
||||||
HandleNotFound(c)
|
HandleNotFound(c)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
artc := Ei.MapArticles[path[:len(path)-5]]
|
||||||
h := GetBase()
|
h := GetBase()
|
||||||
h["Version"] = StaticVersion(c)
|
h["Version"] = StaticVersion(c)
|
||||||
h["Title"] = artc.Title + " | " + Ei.BTitle
|
h["Title"] = artc.Title + " | " + Ei.BTitle
|
||||||
|
|||||||
Reference in New Issue
Block a user