fix out of range about MapArticles

This commit is contained in:
deepzz0
2017-03-02 23:07:36 +08:00
parent 7775ea35a2
commit 4f24b80107
2 changed files with 6 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
### 提醒
标题、slug、内容。在你点击保存的时候一定确保三者不能为空,否则页面刷新内容就没了。所以,养成一个良好的写作习惯很重要。
### 郑重提醒
**标题**、**slug**、**内容**。在你点击保存的时候一定确保三者不能为空,否则页面刷新内容就没了。所以,养成一个良好的写作习惯很重要。
当然,博客的自动保存功能也非常的好。在你不确定是否发布前,你可以将之保存到草稿,以便下次继续编辑。
@@ -55,7 +55,7 @@
x 为小写字母x,y,z中的 x。使页面未加载时也占了相应的位置大小这样设计是为了让读者在浏览页面时不会感到抖动。
如:
```
![sublime-dialog](https://st.deepzz.com/blog/img/dialog-box-without-all-contols.png =640x301)
```

View File

@@ -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