Allow videos in posts, simplify post image view
This commit is contained in:
@ -35,7 +35,7 @@ final class FeedPageGenerator {
|
||||
linkPrefix: String) -> String {
|
||||
var headers = content.postPageHeaders
|
||||
var footer = ""
|
||||
if posts.contains(where: { $0.images.count > 1 }) {
|
||||
if posts.contains(where: { $0.requiresSwiper }) {
|
||||
// Sort swiper style sheet before default style sheet
|
||||
includeSwiper(in: &headers)
|
||||
footer = swiperInitScript(posts: posts)
|
||||
@ -82,7 +82,7 @@ final class FeedPageGenerator {
|
||||
func swiperInitScript(posts: [FeedEntryData]) -> String {
|
||||
var result = "<script> window.onload = () => { "
|
||||
for post in posts {
|
||||
guard post.images.count > 1 else {
|
||||
guard post.requiresSwiper else {
|
||||
continue
|
||||
}
|
||||
result += ImageGallery.swiperInit(id: post.entryId)
|
||||
|
Reference in New Issue
Block a user