Read config path from command line

This commit is contained in:
Christoph Hagen
2022-09-09 11:00:12 +02:00
parent 9965e1a3ff
commit 64db75fb44
3 changed files with 16 additions and 2 deletions

View File

@ -59,7 +59,8 @@ struct PageGenerator {
}
private func makeContent(page: Element, metadata: Element.LocalizedMetadata, language: String, path: String) -> (content: String, includesCode: Bool, isEmpty: Bool) {
if let raw = files.contentOfOptionalFile(atPath: path, source: page.path, createEmptyFileIfMissing: true)?
let create = configuration.createMdFilesIfMissing
if let raw = files.contentOfOptionalFile(atPath: path, source: page.path, createEmptyFileIfMissing: create)?
.trimmed.nonEmpty {
let (content, includesCode) = PageContentGenerator(factory: factory.factory)
.generate(page: page, language: language, content: raw)