Add unique element id for page links
This commit is contained in:
@ -57,6 +57,13 @@ final class FileSystem {
|
||||
*/
|
||||
private var emptyPages: Set<String> = []
|
||||
|
||||
/**
|
||||
All paths to page element folders, indexed by their unique id.
|
||||
|
||||
This relation is used to generate relative links to pages using the ``Element.id`
|
||||
*/
|
||||
private var pagePaths: [String: String] = [:]
|
||||
|
||||
/**
|
||||
The image creation tasks.
|
||||
|
||||
@ -423,6 +430,13 @@ final class FileSystem {
|
||||
}
|
||||
}
|
||||
|
||||
func add(page: String, id: String) {
|
||||
if let existing = pagePaths[id] {
|
||||
log.add(error: "Conflicting id with \(existing)", source: page)
|
||||
}
|
||||
pagePaths[id] = page
|
||||
}
|
||||
|
||||
|
||||
// MARK: Writing files
|
||||
|
||||
|
Reference in New Issue
Block a user