CHGenerator/WebsiteGenerator/main.swift

31 lines
775 B
Swift
Raw Normal View History

2022-08-05 19:03:00 +02:00
import Foundation
private let contentDirectory = URL(fileURLWithPath: "/Users/ch/Projects/MakerSpace")
private let outputDirectory = URL(fileURLWithPath: "/Users/ch/Projects/MakerSpace/Site")
2022-08-19 18:05:06 +02:00
2022-08-29 18:57:58 +02:00
let configuration = Configuration(pageImageWidth: 748)
let log = ValidationLog()
let files = FileSystem(in: contentDirectory, to: outputDirectory)
2022-08-19 18:05:06 +02:00
private let siteData: Element
2022-08-19 18:05:06 +02:00
do {
guard let element = try Element(atRoot: contentDirectory) else {
2022-08-19 18:05:06 +02:00
exit(0)
}
siteData = element
} catch {
print(error)
exit(0)
}
private let siteGenerator = try SiteGenerator()
try siteGenerator.generate(site: siteData)
2022-08-16 10:39:05 +02:00
print("Pages generated")
files.createImages()
2022-08-16 10:39:05 +02:00
print("Images generated")
files.copyRequiredFiles()
2022-08-16 12:26:45 +02:00
print("Required files copied")
files.writeHashes()