Rework content commands, add audio player

This commit is contained in:
Christoph Hagen
2024-12-14 16:31:40 +01:00
parent b3b8c9a610
commit be2aab2ea8
52 changed files with 1758 additions and 767 deletions

View File

@ -22,7 +22,9 @@ struct ContentPage: HtmlProducer {
private let footers: String
init(language: ContentLanguage, dateString: String, title: String, tags: [FeedEntryData.Tag], linkTitle: String, description: String, navigationBarLinks: [NavigationBar.Link], pageContent: String, headers: String, footers: [String]) {
private let icons: Set<PageIcon>
init(language: ContentLanguage, dateString: String, title: String, tags: [FeedEntryData.Tag], linkTitle: String, description: String, navigationBarLinks: [NavigationBar.Link], pageContent: String, headers: String, footers: [String], icons: Set<PageIcon>) {
self.language = language
self.dateString = dateString
self.title = title
@ -33,6 +35,7 @@ struct ContentPage: HtmlProducer {
self.pageContent = pageContent
self.headers = headers
self.footers = footers.joined()
self.icons = icons
}
func populate(_ result: inout String) {
@ -55,13 +58,12 @@ struct ContentPage: HtmlProducer {
result += "</body></html>" // Close content
}
#warning("Select only required symbols")
private let symbols: String = {
private var symbols: String {
var result = "<div style='display:none'>"
for icon in PageIcon.allCases {
result += icon.icon
for icon in icons {
result += icon.icon.content
}
result += "</div>"
return result
}()
}
}