Add image gallery block

This commit is contained in:
Christoph Hagen
2025-05-02 10:00:22 +02:00
parent b3c982b2b9
commit fa2f749b70
7 changed files with 152 additions and 35 deletions

View File

@ -84,14 +84,7 @@ final class FeedPageGenerator {
}
func swiperInitScript(posts: [FeedEntryData]) -> String {
var result = "<script> window.onload = () => { "
for post in posts {
guard post.requiresSwiper else {
continue
}
result += ImageGallery.swiperInit(id: post.entryId)
}
result += "}; </script>"
return result
let ids = posts.filter { $0.requiresSwiper }.map { $0.entryId }
return ImageGallery.combinedFootor(ids: ids)
}
}