🎨 块引新建文档存放位置 支持模板变量 https://github.com/siyuan-note/siyuan/issues/4693

This commit is contained in:
Liang Ding 2022-12-12 10:18:22 +08:00
parent ee6c39744f
commit 533590cd05
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 35 additions and 4 deletions

View file

@ -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()))
}