mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
🎨 块引新建文档存放位置 支持模板变量 https://github.com/siyuan-note/siyuan/issues/4693
This commit is contained in:
@@ -1335,7 +1335,7 @@ func CreateDailyNote(boxID string) (p string, existed bool, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
hPath, err := RenderCreateDocNameTemplate(boxConf.DailyNoteSavePath)
|
||||
hPath, err := RenderGoTemplate(boxConf.DailyNoteSavePath)
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ import (
|
||||
"github.com/siyuan-note/siyuan/kernel/sql"
|
||||
)
|
||||
|
||||
func RenderCreateDocNameTemplate(nameTemplate string) (ret string, err error) {
|
||||
tpl, err := template.New("").Funcs(sprig.TxtFuncMap()).Parse(nameTemplate)
|
||||
func RenderGoTemplate(templateContent string) (ret string, err error) {
|
||||
tpl, err := template.New("").Funcs(sprig.TxtFuncMap()).Parse(templateContent)
|
||||
if nil != err {
|
||||
return "", errors.New(fmt.Sprintf(Conf.Language(44), err.Error()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user