CHGenerator/WebsiteGenerator/main.swift
2022-08-16 12:26:45 +02:00

23 lines
693 B
Swift

import Foundation
let contentDirectory = URL(fileURLWithPath: "/Users/ch/Projects/MakerSpace")
let outputDirectory = URL(fileURLWithPath: "/Users/ch/Projects/MakerSpace/Site")
let files = FileProcessor(
inputFolder: contentDirectory, outputFolder: outputDirectory)
// 1: Load all site content
guard let site = try Site(folder: contentDirectory) else {
exit(0)
}
// site.printContents()
let siteGenerator = try SiteGenerator(site: site, files: files)
try siteGenerator.generate()
print("Pages generated")
try files.createImages()
print("Images generated")
try files.copyRequiredFiles()
print("Required files copied")
#warning("Check that all metadata for each language is present")