Full generation, file type cleanup

This commit is contained in:
Christoph Hagen
2024-12-25 18:06:05 +01:00
parent 41887a1401
commit 1e4682dad1
56 changed files with 1577 additions and 1103 deletions

View File

@@ -36,12 +36,10 @@ final class Page: Item {
var tags: [Tag]
/**
Additional images required by the element.
These images are specified as: `source_name destination_name width (height)`.
Additional files to copy, because the page content references them
*/
@Published
var images: Set<String> = []
var requiredFiles: [FileResource]
init(content: Content,
id: String,
@@ -52,7 +50,8 @@ final class Page: Item {
endDate: Date?,
german: LocalizedPage,
english: LocalizedPage,
tags: [Tag]) {
tags: [Tag],
requiredFiles: [FileResource]) {
self.externalLink = externalLink
self.isDraft = isDraft
self.createdDate = createdDate
@@ -62,6 +61,7 @@ final class Page: Item {
self.german = german
self.english = english
self.tags = tags
self.requiredFiles = requiredFiles
super.init(content: content, id: id)
}
@@ -109,12 +109,20 @@ final class Page: Item {
}
override var itemType: ItemType {
.page
.page(self)
}
func contains(urlComponent: String) -> Bool {
english.urlString == urlComponent || german.urlString == urlComponent
}
func pageContent(in language: ContentLanguage) -> String? {
content.storage.pageContent(for: id, language: language)
}
func hasContent(in language: ContentLanguage) -> Bool {
content.storage.hasPageContent(for: id, language: language)
}
}
extension Page: DateItem {