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

33 lines
618 B
Swift
Raw 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
static let templateName = "header-center.html"
}
struct LeftHeaderTemplate: Template {
typealias Key = HeaderKey
let raw: String
static let templateName = "header-left.html"
}