Skip to content

Commit

Permalink
refactor(internal/vars): 添加 DraftTitleAround 配置项
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Feb 11, 2022
1 parent 0ece327 commit f65e614
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/loader/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions internal/vars/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ const (
TagsTemplate = "tags"
ArchiveTemplate = "archive"

Ext = ".html" // 生成后的文件后缀名
MarkdownExt = ".md"
Ext = ".html" // 生成后的文件后缀名
MarkdownExt = ".md"
DraftTitleAround = "**" // 草稿文章的标题围绕的字符

// HighlightClassPrefix 默认的高亮主题色
// 值可以从 github.com/alecthomas/chroma/styles 获取
Expand Down

0 comments on commit f65e614

Please sign in to comment.