Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve dynamic icon kernel api for rendering template https://github.com/siyuan-note/siyuan/issues/13095

Daniel2178a15236d2
diff --git a/kernel/api/icon.go b/kernel/api/icon.go
index f6048ed870..6067c5ce81 100644
--- a/kernel/api/icon.go
+++ b/kernel/api/icon.go
@@ -521,6 +521,10 @@ func generateTypeSevenSVG(color string, lang string, dateInfo map[string]interfa
// Type 8: 文字图标
func generateTypeEightSVG(color, content, id string) string {
+ if strings.Contains(content, ".action{") {
+ content = model.RenderDynamicIconContentTemplate(content, id)
+ }
+
colorScheme := getColorScheme(color)
// 动态变化字体大小
@@ -558,10 +562,6 @@ func generateTypeEightSVG(color, content, id string) string {
}
}
- if strings.Contains(content, ".action{") {
- content = model.RenderDynamicIconContentTemplate(content, id)
- }
-
return fmt.Sprintf(`
<svg id="dynamic_icon_type8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path d="M39,0h434c20.97,0,38,17.03,38,38v412c0,33.11-26.89,60-60,60H60c-32.56,0-59-26.44-59-59V38C1,17.03,18.03,0,39,0Z" style="fill: %s;"/>