CHGenerator/Sources/Generator/Templates/Pages/HeaderTemplate.swift

37 lines
704 B
Swift
Raw Permalink Normal View History

2022-08-16 12:27:13 +02:00
import Foundation
protocol HeaderTemplate {
func generate(_ content: [ThumbnailKey : String], shouldIndent: Bool) throws -> String
}
enum HeaderKey: String, CaseIterable {
case backLink = "BACK_LINK"
case title = "TITLE"
case subtitle = "SUBTITLE"
case titleText = "TITLE_TEXT"
case date = "DATE"
}
struct CenteredHeaderTemplate: Template {
typealias Key = HeaderKey
let raw: String
2022-12-02 10:25:54 +01:00
let results: GenerationResultsHandler
2022-08-16 12:27:13 +02:00
static let templateName = "header-center.html"
}
struct LeftHeaderTemplate: Template {
typealias Key = HeaderKey
let raw: String
2022-12-02 10:25:54 +01:00
let results: GenerationResultsHandler
2022-08-16 12:27:13 +02:00
static let templateName = "header-left.html"
}