diff --git a/internal/loader/post.go b/internal/loader/post.go index 14d7e26..243927a 100644 --- a/internal/loader/post.go +++ b/internal/loader/post.go @@ -134,7 +134,7 @@ func (p *Post) sanitize(path string) *FieldError { return &FieldError{Field: "title", Message: localeutil.Phrase("can not be empty")} } if p.State == StateDraft { // 对草稿稍微做一下标记 - p.Title = "**" + p.Title + "**" + p.Title = vars.DraftTitleAround + p.Title + vars.DraftTitleAround } slug := Slug(path) diff --git a/internal/vars/vars.go b/internal/vars/vars.go index 8bc849d..550673d 100644 --- a/internal/vars/vars.go +++ b/internal/vars/vars.go @@ -31,8 +31,9 @@ const ( TagsTemplate = "tags" ArchiveTemplate = "archive" - Ext = ".html" // 生成后的文件后缀名 - MarkdownExt = ".md" + Ext = ".html" // 生成后的文件后缀名 + MarkdownExt = ".md" + DraftTitleAround = "**" // 草稿文章的标题围绕的字符 // HighlightClassPrefix 默认的高亮主题色 // 值可以从 github.com/alecthomas/chroma/styles 获取