mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 18:10:12 +01:00
🎨 Database gallery view https://github.com/siyuan-note/siyuan/issues/10414
This commit is contained in:
parent
e1c1c806d6
commit
0440d94f71
1 changed files with 49 additions and 42 deletions
|
|
@ -341,7 +341,10 @@ func fillGalleryCardCover(attrView *av.AttributeView, view *av.View, cardValues
|
|||
case av.CoverFromNone:
|
||||
case av.CoverFromContentImage:
|
||||
blockValue := getBlockValue(cardValues)
|
||||
if !blockValue.IsDetached {
|
||||
if blockValue.IsDetached {
|
||||
break
|
||||
}
|
||||
|
||||
tree := loadTreeByBlockID(blockValue.BlockID)
|
||||
if nil == tree {
|
||||
break
|
||||
|
|
@ -356,6 +359,11 @@ func fillGalleryCardCover(attrView *av.AttributeView, view *av.View, cardValues
|
|||
galleryCard.CoverURL = titleImg
|
||||
break
|
||||
}
|
||||
|
||||
if titleImgCss := node.IALAttr("title-img"); strings.HasPrefix(titleImgCss, "background:") {
|
||||
galleryCard.CoverURL = titleImgCss
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
ast.Walk(node, func(n *ast.Node, entering bool) ast.WalkStatus {
|
||||
|
|
@ -390,7 +398,6 @@ func fillGalleryCardCover(attrView *av.AttributeView, view *av.View, cardValues
|
|||
galleryCard.CoverContent = buf.String()
|
||||
return
|
||||
}
|
||||
}
|
||||
case av.CoverFromAssetField:
|
||||
if "" == view.Gallery.CoverFromAssetKeyID {
|
||||
break
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue