Fix og:image video image

This commit is contained in:
Alan Grainger
2026-05-29 17:29:16 +08:00
parent 9fee829259
commit 1906f3ceeb
+5 -1
View File
@@ -50,7 +50,11 @@ export function Gallery (props: GalleryProps) {
groupByDate: props.groupByDate
})
const firstItem = props.items[0]
const ogImageUrl = firstItem ? props.publicBaseUrl + firstItem.previewUrl : ''
// For videos, previewUrl points to the .mp4; use thumbnailUrl so og:image is always a still JPEG.
const ogImageAsset = firstItem
? (firstItem.type === AssetType.video ? firstItem.thumbnailUrl : firstItem.previewUrl)
: ''
const ogImageUrl = firstItem ? props.publicBaseUrl + ogImageAsset : ''
return (
<html lang="en">