CHGenerator/WebsiteGenerator/Content/Site+Metadata.swift
Christoph Hagen 14b935249f First version
2022-08-16 10:39:05 +02:00

49 lines
1005 B
Swift

import Foundation
extension Site {
struct Metadata {
let author: String
let ignoredSubFolders: Set<String>
let topBarTitle: String?
/**
The url where the site will be deployed.
This value is required to build absolute links for link previews.
- Note: The path does not need to contain a trailing slash.
*/
let deployedBaseUrl: String
let languages: [LocalizedMetadata]
static func write(to url: URL) throws {
try Metadata.initial.writeJSON(to: url)
}
}
}
extension Site.Metadata: LanguageContainer {
}
extension Site.Metadata: Codable {
}
extension Site.Metadata: Metadata {
static let fileName = "site.json"
static var initial: Self {
.init(author: "Author",
ignoredSubFolders: ["templates"],
topBarTitle: "<b>Title</b>",
deployedBaseUrl: "http://example.com",
languages: [.initial])
}
}