29 lines
719 B
Swift
29 lines
719 B
Swift
import Foundation
|
|
|
|
private let contentDirectory = URL(fileURLWithPath: "/Users/ch/Projects/MakerSpace")
|
|
private let outputDirectory = URL(fileURLWithPath: "/Users/ch/Projects/MakerSpace/Site")
|
|
|
|
let log = ValidationLog()
|
|
let files = FileSystem(in: contentDirectory, to: outputDirectory)
|
|
|
|
private let siteData: Element
|
|
do {
|
|
guard let element = try Element(atRoot: contentDirectory) else {
|
|
exit(0)
|
|
}
|
|
siteData = element
|
|
} catch {
|
|
print(error)
|
|
exit(0)
|
|
}
|
|
|
|
private let siteGenerator = try SiteGenerator()
|
|
try siteGenerator.generate(site: siteData)
|
|
|
|
print("Pages generated")
|
|
files.createImages()
|
|
print("Images generated")
|
|
files.copyRequiredFiles()
|
|
print("Required files copied")
|
|
files.writeHashes()
|