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 let results: GenerationResultsHandler static let templateName = "header-center.html" } struct LeftHeaderTemplate: Template { typealias Key = HeaderKey let raw: String let results: GenerationResultsHandler static let templateName = "header-left.html" }