CHGenerator/WebsiteGenerator/main.swift
2022-08-29 19:20:13 +02:00

32 lines
799 B
Swift

import Foundation
private let contentDirectory = URL(fileURLWithPath: "/Users/ch/Projects/MakerSpace")
private let outputDirectory = URL(fileURLWithPath: "/Users/ch/Projects/MakerSpace/Site")
let configuration = Configuration(pageImageWidth: 748)
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()
files.printEmptyPages()
print("Images generated")
files.copyRequiredFiles()
print("Required files copied")
files.writeHashes()