Access site root globally
This commit is contained in:
parent
fdd4c0e4d9
commit
66dcd43082
@ -4,6 +4,7 @@ import ArgumentParser
|
||||
var configuration: Configuration!
|
||||
let log = ValidationLog()
|
||||
var files: FileSystem!
|
||||
var siteRoot: Element!
|
||||
|
||||
@main
|
||||
struct CHGenerator: ParsableCommand {
|
||||
@ -25,11 +26,12 @@ private func generate(configPath: String) throws {
|
||||
in: configuration.contentDirectory,
|
||||
to: configuration.outputDirectory)
|
||||
|
||||
guard let siteData = Element(atRoot: configuration.contentDirectory) else {
|
||||
siteRoot = Element(atRoot: configuration.contentDirectory)
|
||||
guard siteRoot != nil else {
|
||||
return
|
||||
}
|
||||
let siteGenerator = try SiteGenerator()
|
||||
siteGenerator.generate(site: siteData)
|
||||
siteGenerator.generate(site: siteRoot)
|
||||
|
||||
files.printGeneratedPages()
|
||||
files.printEmptyPages()
|
||||
|
Loading…
Reference in New Issue
Block a user