35 lines
729 B
Swift
35 lines
729 B
Swift
import Foundation
|
|
|
|
|
|
let configuration = Configuration(
|
|
pageImageWidth: <#T##Int#>,
|
|
minifyCSSandJS: <#T##Bool#>,
|
|
contentPath: <#T##String#>,
|
|
outputPath: <#T##String#>)
|
|
|
|
let log = ValidationLog()
|
|
let files = FileSystem(
|
|
in: configuration.contentDirectory,
|
|
to: configuration.outputDirectory)
|
|
|
|
do {
|
|
guard let siteData = try Element(atRoot: configuration.contentDirectory) else {
|
|
exit(0)
|
|
}
|
|
|
|
let siteGenerator = try SiteGenerator()
|
|
try siteGenerator.generate(site: siteData)
|
|
} catch {
|
|
print(error)
|
|
exit(0)
|
|
}
|
|
|
|
files.printGeneratedPages()
|
|
files.printEmptyPages()
|
|
files.printDraftPages()
|
|
|
|
files.createImages()
|
|
print("Images generated")
|
|
files.copyRequiredFiles()
|
|
files.writeHashes()
|