mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-25 17:56:09 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
91b337f896
2 changed files with 10 additions and 0 deletions
|
|
@ -144,6 +144,7 @@ func (PublishServiceTransport) RoundTrip(request *http.Request) (response *http.
|
|||
Header: http.Header{
|
||||
model.BasicAuthHeaderKey: {model.BasicAuthHeaderValue},
|
||||
},
|
||||
Body: http.NoBody,
|
||||
Close: false,
|
||||
ContentLength: -1,
|
||||
}, nil
|
||||
|
|
|
|||
|
|
@ -479,6 +479,8 @@ func RenderTemplateCol(ial map[string]string, rowValues []*av.KeyValues, tplCont
|
|||
}
|
||||
}
|
||||
|
||||
dataModel["id"] = map[string]any{}
|
||||
dataModel["id_raw"] = map[string]any{}
|
||||
for _, rowValue := range rowValues {
|
||||
if 1 > len(rowValue.Values) {
|
||||
continue
|
||||
|
|
@ -541,6 +543,13 @@ func RenderTemplateCol(ial map[string]string, rowValues []*av.KeyValues, tplCont
|
|||
} else {
|
||||
dataModel[rowValue.Key.Name] = v.String(true)
|
||||
}
|
||||
|
||||
// Database template fields support access to the raw value https://github.com/siyuan-note/siyuan/issues/14903
|
||||
dataModel[rowValue.Key.Name+"_raw"] = v
|
||||
|
||||
// Database template fields support access by ID https://github.com/siyuan-note/siyuan/issues/11237
|
||||
dataModel["id"].(map[string]any)[rowValue.Key.ID] = dataModel[rowValue.Key.Name]
|
||||
dataModel["id_raw"].(map[string]any)[rowValue.Key.ID] = v
|
||||
}
|
||||
|
||||
if err = tpl.Execute(buf, dataModel); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue