mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
This commit is contained in:
parent
31f5797176
commit
9933cd98ec
2 changed files with 12 additions and 1 deletions
|
|
@ -201,7 +201,10 @@ func fillAttributeViewGalleryCardCover(attrView *av.AttributeView, view *av.View
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
galleryCard.CoverURL = assetValue.MAsset[0].Content
|
p := assetValue.MAsset[0].Content
|
||||||
|
if util.IsAssetsImage(p) {
|
||||||
|
galleryCard.CoverURL = p
|
||||||
|
}
|
||||||
return
|
return
|
||||||
case av.CoverFromContentBlock:
|
case av.CoverFromContentBlock:
|
||||||
blockValue := getBlockValue(cardValues)
|
blockValue := getBlockValue(cardValues)
|
||||||
|
|
|
||||||
|
|
@ -317,6 +317,14 @@ var (
|
||||||
SiYuanAssetsVideo = []string{".mov", ".weba", ".mkv", ".mp4", ".webm"}
|
SiYuanAssetsVideo = []string{".mov", ".weba", ".mkv", ".mp4", ".webm"}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func IsAssetsImage(p string) bool {
|
||||||
|
ext := strings.ToLower(filepath.Ext(p))
|
||||||
|
if "" == ext {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return gulu.Str.Contains(ext, SiYuanAssetsImage)
|
||||||
|
}
|
||||||
|
|
||||||
func IsDisplayableAsset(p string) bool {
|
func IsDisplayableAsset(p string) bool {
|
||||||
ext := strings.ToLower(filepath.Ext(p))
|
ext := strings.ToLower(filepath.Ext(p))
|
||||||
if "" == ext {
|
if "" == ext {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue