Convert Xcode project to swift package
This commit is contained in:
32
Sources/Generator/Templates/Pages/HeaderTemplate.swift
Normal file
32
Sources/Generator/Templates/Pages/HeaderTemplate.swift
Normal file
@ -0,0 +1,32 @@
|
||||
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"
|
||||
}
|
21
Sources/Generator/Templates/Pages/PageTemplate.swift
Normal file
21
Sources/Generator/Templates/Pages/PageTemplate.swift
Normal file
@ -0,0 +1,21 @@
|
||||
import Foundation
|
||||
|
||||
struct PageTemplate: Template {
|
||||
|
||||
enum Key: String, CaseIterable {
|
||||
case head = "HEAD"
|
||||
case topBar = "TOP_BAR"
|
||||
case contentClass = "CONTENT_CLASS"
|
||||
case header = "HEADER"
|
||||
case content = "CONTENT"
|
||||
case previousPageLinkText = "PREV_TEXT"
|
||||
case previousPageUrl = "PREV_LINK"
|
||||
case nextPageLinkText = "NEXT_TEXT"
|
||||
case nextPageUrl = "NEXT_LINK"
|
||||
case footer = "FOOTER"
|
||||
}
|
||||
|
||||
static let templateName = "page.html"
|
||||
|
||||
let raw: String
|
||||
}
|
Reference in New Issue
Block a user