CHGenerator/WebsiteGenerator/main.swift

23 lines
693 B
Swift
Raw Normal View History

2022-08-05 19:03:00 +02:00
import Foundation
2022-08-16 10:39:05 +02:00
let contentDirectory = URL(fileURLWithPath: "/Users/ch/Projects/MakerSpace")
let outputDirectory = URL(fileURLWithPath: "/Users/ch/Projects/MakerSpace/Site")
2022-08-16 12:26:45 +02:00
let files = FileProcessor(
2022-08-16 10:39:05 +02:00
inputFolder: contentDirectory, outputFolder: outputDirectory)
// 1: Load all site content
guard let site = try Site(folder: contentDirectory) else {
exit(0)
}
// site.printContents()
2022-08-16 12:26:45 +02:00
let siteGenerator = try SiteGenerator(site: site, files: files)
2022-08-16 10:39:05 +02:00
try siteGenerator.generate()
print("Pages generated")
2022-08-16 12:26:45 +02:00
try files.createImages()
2022-08-16 10:39:05 +02:00
print("Images generated")
2022-08-16 12:26:45 +02:00
try files.copyRequiredFiles()
print("Required files copied")
2022-08-05 19:03:00 +02:00
2022-08-16 10:39:05 +02:00
#warning("Check that all metadata for each language is present")