Allow videos in posts, simplify post image view

This commit is contained in:
Christoph Hagen
2025-01-17 23:24:56 +01:00
parent 60716fca20
commit bc3f21e7e4
10 changed files with 175 additions and 172 deletions

View File

@ -14,7 +14,14 @@ struct FeedEntry {
var content: String {
var result = "<article><div class='card\(cardLinkClassText)'>"
ImageGallery(id: data.entryId, images: data.images).populate(&result)
switch data.media {
case .images(let images):
ImageGallery(id: data.entryId, images: images).populate(&result)
case .video(let videos):
PostVideo(videos: videos).populate(&result)
case .none:
break
}
if let url = data.link?.url {
result += "<div class='card-content' onclick=\"window.location.href='\(url)'\">"