Finish most recent and featured section

This commit is contained in:
Christoph Hagen
2022-12-07 01:01:13 +01:00
parent f185191b7f
commit 3bd75a63ab
10 changed files with 209 additions and 27 deletions

View File

@ -0,0 +1,22 @@
import Foundation
struct SlideshowImageTemplate: Template {
enum Key: String, CaseIterable {
case url = "URL"
case image = "IMAGE"
case title = "TITLE"
case subtitle = "SUBTITLE"
case number = "NUMBER"
}
static let templateName = "slideshow-image.html"
let raw: String
let results: GenerationResultsHandler
func makePath(components: [String]) -> String {
components.joined(separator: " » ") //  » ")
}
}

View File

@ -0,0 +1,15 @@
import Foundation
struct SlideshowTemplate: Template {
enum Key: String, CaseIterable {
case title = "TITLE"
case content = "CONTENT"
}
static let templateName = "slideshow.html"
let raw: String
let results: GenerationResultsHandler
}

View File

@ -0,0 +1,14 @@
import Foundation
struct SlideshowsTemplate: Template {
enum Key: String, CaseIterable {
case content = "CONTENT"
}
static let templateName = "slideshows.html"
let raw: String
let results: GenerationResultsHandler
}

View File

@ -67,7 +67,7 @@ struct LocalizedSiteTemplate {
sections: sections,
topBarWebsiteTitle: site.topBarTitle)
self.pageHead = PageHeadGenerator(factory: factory, results: results)
self.overviewSection = OverviewSectionGenerator(factory: factory, results: results)
self.overviewSection = OverviewSectionGenerator(factory: factory, siteRoot: site, results: results)
}
// MARK: Content

View File

@ -53,6 +53,14 @@ final class TemplateFactory {
let video: PageVideoTemplate
// MARK: Slideshow
let slideshows: SlideshowsTemplate
let slideshow: SlideshowTemplate
let slideshowImage: SlideshowImageTemplate
// MARK: HTML
let html: HTMLElementsGenerator
@ -76,6 +84,9 @@ final class TemplateFactory {
self.page = try .init(in: templateFolder, results: results)
self.image = try .init(in: templateFolder, results: results)
self.video = try .init(in: templateFolder, results: results)
self.slideshow = try .init(in: templateFolder, results: results)
self.slideshows = try .init(in: templateFolder, results: results)
self.slideshowImage = try .init(in: templateFolder, results: results)
self.html = .init()
}