From f65e6146c9f3bb848b1965c51483aa1c133ebcae Mon Sep 17 00:00:00 2001 From: caixw Date: Fri, 11 Feb 2022 21:37:14 +0800 Subject: [PATCH] =?UTF-8?q?refactor(internal/vars):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20DraftTitleAround=20=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/loader/post.go | 2 +- internal/vars/vars.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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 获取