mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 07:48:49 +01:00
🎨 Creating a dailynote template supports doc attributes https://github.com/siyuan-note/siyuan/issues/10698
This commit is contained in:
parent
8b7e6661f5
commit
5c6be798f4
1 changed files with 3 additions and 0 deletions
|
|
@ -1125,12 +1125,15 @@ func CreateDailyNote(boxID string) (p string, existed bool, err error) {
|
|||
for _, c := range children {
|
||||
tree.Root.AppendChild(c)
|
||||
}
|
||||
|
||||
// Creating a dailynote template supports doc attributes https://github.com/siyuan-note/siyuan/issues/10698
|
||||
templateIALs := parse.IAL2Map(templateTree.Root.KramdownIAL)
|
||||
for k, v := range templateIALs {
|
||||
if "name" == k || "alias" == k || "bookmark" == k || "memo" == k || "title" == k || strings.HasPrefix(k, "custom-") {
|
||||
tree.Root.SetIALAttr(k, v)
|
||||
}
|
||||
}
|
||||
|
||||
tree.Root.SetIALAttr("updated", util.CurrentTimeSecondsStr())
|
||||
if err = indexWriteJSONQueue(tree); nil != err {
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue