import Foundation struct FeedNavigationLink { let text: String let url: String } struct Feed { private let navigationIconPath = "/assets/icons/ch.svg" let language: ContentLanguage let title: String let description: String let iconDescription: String let navigationItems: [FeedNavigationLink] let posts: [FeedEntryData] var content: String { #warning("TODO: Split feed into multiple pages") var result = "" result += "" let head = PageHead( title: title, description: description) 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 += "" } } }