mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
✨ 增加公共代码 js/css 片段 https://github.com/siyuan-note/siyuan/issues/6143
This commit is contained in:
parent
d63c63bbd7
commit
1a8c519fb3
1 changed files with 4 additions and 1 deletions
|
@ -35,7 +35,7 @@ func getSnippet(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
typ := arg["type"].(string)
|
||||
typ := arg["type"].(string) // js/css/all
|
||||
enabledArg := int(arg["enabled"].(float64)) // 0:禁用,1:启用,2:全部
|
||||
enabled := true
|
||||
if 0 == enabledArg {
|
||||
|
@ -55,6 +55,9 @@ func getSnippet(c *gin.Context) {
|
|||
snippets = append(snippets, s)
|
||||
}
|
||||
}
|
||||
if 1 > len(snippets) {
|
||||
snippets = []*conf.Snippet{}
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"snippets": snippets,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue