2022-08-05 19:03:00 +02:00
|
|
|
import Foundation
|
|
|
|
|
2022-08-26 17:40:51 +02:00
|
|
|
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)
|
|
|
|
|
2022-08-26 17:40:51 +02:00
|
|
|
let log = ValidationLog()
|
|
|
|
let files = FileSystem(in: contentDirectory, to: outputDirectory)
|
2022-08-19 18:05:06 +02:00
|
|
|
|
2022-08-26 17:40:51 +02:00
|
|
|
private let siteData: Element
|
2022-08-19 18:05:06 +02:00
|
|
|
do {
|
2022-08-26 17:40:51 +02:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2022-08-26 17:40:51 +02:00
|
|
|
private let siteGenerator = try SiteGenerator()
|
|
|
|
try siteGenerator.generate(site: siteData)
|
2022-08-16 10:39:05 +02:00
|
|
|
|
|
|
|
print("Pages generated")
|
2022-08-26 17:40:51 +02:00
|
|
|
files.createImages()
|
2022-08-16 10:39:05 +02:00
|
|
|
print("Images generated")
|
2022-08-26 17:40:51 +02:00
|
|
|
files.copyRequiredFiles()
|
2022-08-16 12:26:45 +02:00
|
|
|
print("Required files copied")
|
2022-08-26 17:40:51 +02:00
|
|
|
files.writeHashes()
|