diff --git a/docs/writing.md b/docs/writing.md index 295da46..0e5b566 100644 --- a/docs/writing.md +++ b/docs/writing.md @@ -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) - +``` diff --git a/front.go b/front.go index 1967fce..e7b0e69 100644 --- a/front.go +++ b/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