Full generation, file type cleanup
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user