import Foundation struct FeedNavigationLink { let text: LocalizedText let url: LocalizedText } struct Feed { private let navigationIconPath = "/assets/icons/ch.svg" let language: ContentLanguage let title: LocalizedText let description: LocalizedText let iconDescription: LocalizedText let navigationItems: [FeedNavigationLink] let posts: [FeedEntryData] var content: String { #warning("TODO: Split feed into multiple pages") var result = "" result += "" let head = PageHead( title: title.getText(for: language), description: description.getText(for: language)) result += head.content result += "" addNavbar(to: &result) result += "
" for post in posts { FeedEntry(data: post) .addContent(to: &result) } addSwiperInits(to: &result) result += "
" // Close content return result } #warning("TODO: Set correct navigation links and texts") private func addNavbar(to result: inout String) { result += "" // Close nav-center, navbar } private func addSwiperInits(to result: inout String) { if posts.contains(where: { $0.images.count > 1 }) { result += "" } } }