Improve overview of modified pages
This commit is contained in:
parent
6a2d63462e
commit
d1c418af3e
@ -76,6 +76,11 @@ final class FileSystem {
|
||||
*/
|
||||
private var imageTasks: [String : ImageOutput] = [:]
|
||||
|
||||
/**
|
||||
The paths to all pages which were changed
|
||||
*/
|
||||
private var generatedPages: Set<String> = []
|
||||
|
||||
init(in input: URL, to output: URL) {
|
||||
self.input = input
|
||||
self.output = output
|
||||
@ -474,6 +479,21 @@ final class FileSystem {
|
||||
pagePaths[id]
|
||||
}
|
||||
|
||||
func generated(page: String) {
|
||||
generatedPages.insert(page)
|
||||
}
|
||||
|
||||
func printGeneratedPages() {
|
||||
guard !generatedPages.isEmpty else {
|
||||
print("No pages modified")
|
||||
return
|
||||
}
|
||||
print("\(generatedPages.count) pages modified")
|
||||
for page in generatedPages.sorted() {
|
||||
print(" " + page)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: Writing files
|
||||
|
||||
|
@ -29,7 +29,7 @@ struct IndexPageGenerator {
|
||||
guard factory.page.generate(content, to: pageUrl) else {
|
||||
return
|
||||
}
|
||||
log.add(info: "Page generated", source: path)
|
||||
files.generated(page: path)
|
||||
}
|
||||
|
||||
private func makeHeader(page: Element, metadata: Element.LocalizedMetadata, language: String) -> String {
|
||||
|
@ -29,7 +29,7 @@ struct OverviewPageGenerator {
|
||||
guard factory.page.generate(content, to: url) else {
|
||||
return
|
||||
}
|
||||
log.add(info: "Page generated", source: path)
|
||||
files.generated(page: path)
|
||||
}
|
||||
|
||||
private func makeContent(section: Element, language: String) -> String {
|
||||
|
@ -57,7 +57,7 @@ struct PageGenerator {
|
||||
guard factory.page.generate(content, to: url) else {
|
||||
return
|
||||
}
|
||||
log.add(info: "Page generated", source: path)
|
||||
files.generated(page: path)
|
||||
}
|
||||
|
||||
private func makeContent(page: Element, language: String, path: String) -> (content: String, includesCode: Bool)? {
|
||||
|
@ -22,11 +22,11 @@ do {
|
||||
private let siteGenerator = try SiteGenerator()
|
||||
try siteGenerator.generate(site: siteData)
|
||||
|
||||
print("Pages generated\n")
|
||||
files.createImages()
|
||||
files.printGeneratedPages()
|
||||
files.printEmptyPages()
|
||||
files.printDraftPages()
|
||||
|
||||
files.createImages()
|
||||
print("Images generated")
|
||||
files.copyRequiredFiles()
|
||||
print("Required files copied")
|
||||
files.writeHashes()
|
||||
|
Loading…
Reference in New Issue
Block a user