mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-22 00:06:09 +01:00
🎨 Database gallery view https://github.com/siyuan-note/siyuan/issues/10414
This commit is contained in:
parent
6ba4058a13
commit
0d2e753c5e
2 changed files with 82 additions and 18 deletions
|
|
@ -22,12 +22,21 @@ import "sort"
|
|||
type LayoutGallery struct {
|
||||
*BaseLayout
|
||||
|
||||
CoverFrom int `json:"coverFrom"` // 封面来源,0:无,1:内容图,2:资源字段
|
||||
CoverFrom CoverFrom `json:"coverFrom"` // 封面来源,0:无,1:内容图,2:资源字段
|
||||
CoverFromAssetKeyID string `json:"coverFromAssetKeyId,omitempty"` // 资源字段 ID,CoverFrom 为 2 时有效
|
||||
CardFields []*ViewGalleryCardField `json:"fields"` // 画廊卡片字段
|
||||
CardIDs []string `json:"cardIds"` // 卡片 ID,用于自定义排序
|
||||
}
|
||||
|
||||
// CoverFrom 描述了画廊中的卡片封面来源的枚举类型。
|
||||
type CoverFrom int
|
||||
|
||||
const (
|
||||
CoverFromNone CoverFrom = iota // 无封面
|
||||
CoverFromContentImage // 内容图
|
||||
CoverFromAssetField // 资源字段
|
||||
)
|
||||
|
||||
// ViewGalleryCardField 描述了画廊卡片字段的结构。
|
||||
type ViewGalleryCardField struct {
|
||||
ID string `json:"id"` // 字段 ID
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue