Remove global configuration and improve printing
This commit is contained in:
@ -120,11 +120,10 @@ struct PageContentGenerator {
|
||||
private func handleImage(page: Element, file: String, rightTitle: String?, leftTitle: String?) -> String {
|
||||
let imagePath = page.pathRelativeToRootForContainedInputFile(file)
|
||||
|
||||
let size = files.requireMultiVersionImage(
|
||||
let size = files.requireFullSizeMultiVersionImage(
|
||||
source: imagePath,
|
||||
destination: imagePath,
|
||||
requiredBy: page.path,
|
||||
width: configuration.pageImageWidth)
|
||||
requiredBy: page.path)
|
||||
|
||||
let content: [PageImageTemplate.Key : String] = [
|
||||
.image: file.dropAfterLast("."),
|
||||
|
@ -73,9 +73,7 @@ struct PageGenerator {
|
||||
}
|
||||
|
||||
private func makeContent(page: Element, metadata: Element.LocalizedMetadata, language: String, path: String) -> (content: String, includesCode: Bool, isEmpty: Bool) {
|
||||
let create = configuration.createMdFilesIfMissing
|
||||
if let raw = files.contentOfOptionalFile(atPath: path, source: page.path, createEmptyFileIfMissing: create)?
|
||||
.trimmed.nonEmpty {
|
||||
if let raw = files.contentOfMdFile(atPath: path, source: page.path)?.trimmed.nonEmpty {
|
||||
let (content, includesCode) = PageContentGenerator(factory: factory.factory)
|
||||
.generate(page: page, language: language, content: raw)
|
||||
return (content, includesCode, false)
|
||||
|
Reference in New Issue
Block a user