mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
Remove dead TemplateContext protocol
This commit is contained in:
parent
4b3dee6706
commit
d184ed06fa
4 changed files with 6 additions and 16 deletions
|
|
@ -14,7 +14,7 @@ struct PageContext {
|
|||
let metadata: [String: String]
|
||||
}
|
||||
|
||||
extension PageContext: TemplateContext {
|
||||
extension PageContext {
|
||||
var template: String {
|
||||
page.template ?? site.template
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ struct SiteContext {
|
|||
}
|
||||
}
|
||||
|
||||
extension SiteContext: TemplateContext {
|
||||
extension SiteContext {
|
||||
var dictionary: [String: Any] {
|
||||
[
|
||||
"site": site,
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
//
|
||||
// TemplateContext.swift
|
||||
// SiteGenerator
|
||||
//
|
||||
// Created by Sami Samhuri on 2019-12-02.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
protocol TemplateContext {
|
||||
var template: String { get }
|
||||
|
||||
var dictionary: [String : Any] { get }
|
||||
}
|
||||
|
|
@ -20,6 +20,8 @@ struct MonthPosts {
|
|||
}
|
||||
}
|
||||
|
||||
// MARK: -
|
||||
|
||||
struct YearPosts {
|
||||
let year: Int
|
||||
var byMonth: [Month: MonthPosts]
|
||||
|
|
@ -46,6 +48,8 @@ struct YearPosts {
|
|||
}
|
||||
}
|
||||
|
||||
// MARK: -
|
||||
|
||||
struct PostsByYear {
|
||||
private(set) var byYear: [Int: YearPosts]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue