Update icons, hide page title

This commit is contained in:
Christoph Hagen
2024-12-26 15:01:01 +01:00
parent 1e4682dad1
commit 922ba4ebe7
23 changed files with 290 additions and 53 deletions

View File

@ -12,6 +12,8 @@ struct ContentPage: HtmlProducer {
private let title: String
private let showTitle: Bool
private let tags: [FeedEntryData.Tag]
private let navigationBarLinks: [NavigationBar.Link]
@ -24,10 +26,21 @@ struct ContentPage: HtmlProducer {
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: Set<HeaderElement>, footers: [String], icons: Set<PageIcon>) {
init(language: ContentLanguage,
dateString: String,
title: String,
showTitle: Bool,
tags: [FeedEntryData.Tag],
linkTitle: String,
description: String,
navigationBarLinks: [NavigationBar.Link],
pageContent: String,
headers: Set<HeaderElement>,
footers: [String], icons: Set<PageIcon>) {
self.language = language
self.dateString = dateString
self.title = title
self.showTitle = showTitle
self.tags = tags
self.linkTitle = linkTitle
self.description = description
@ -47,9 +60,11 @@ struct ContentPage: HtmlProducer {
result += "<main><article>"
result += "<div style=\"height: 70px;\"></div>"
result += "<h3>\(dateString)</h3>"
result += "<h1>\(title)</h1>"
result += TagList(tags: tags).content
if showTitle {
result += "<h3>\(dateString)</h3>"
result += "<h1>\(title)</h1>"
result += TagList(tags: tags).content
}
result += symbols
result += pageContent
result += "</article></main>"
@ -59,6 +74,9 @@ struct ContentPage: HtmlProducer {
}
private var symbols: String {
guard !icons.isEmpty else {
return ""
}
var result = "<div style='display:none'>"
for icon in icons {
result += icon.icon.content