🎨 Creating a dailynote template supports doc attributes https://github.com/siyuan-note/siyuan/issues/10698

This commit is contained in:
Daniel 2024-03-22 19:47:03 +08:00
parent 8b7e6661f5
commit 5c6be798f4
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -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