Fix page paths
Update PostListPageGenerator.swift
This commit is contained in:
@ -38,7 +38,7 @@ struct SecurityBookmark {
|
||||
}
|
||||
|
||||
func fullPath(to relativePath: String) -> URL {
|
||||
url.appending(path: relativePath, directoryHint: .notDirectory)
|
||||
return url.appending(path: relativePath.withLeadingSlashRemoved, directoryHint: .notDirectory)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -167,7 +167,7 @@ struct SecurityBookmark {
|
||||
return false
|
||||
}
|
||||
|
||||
let destination = url.appending(path: relativeDestination)
|
||||
let destination = url.appending(path: relativeDestination.withLeadingSlashRemoved)
|
||||
if exists(destination) {
|
||||
switch overwrite {
|
||||
case .fail:
|
||||
@ -328,11 +328,11 @@ struct SecurityBookmark {
|
||||
// MARK: Generic operations
|
||||
|
||||
func with(relativePath: String, perform operation: (URL) -> Bool) -> Bool {
|
||||
perform { operation($0.appending(path: relativePath)) }
|
||||
perform { operation($0.appending(path: relativePath.withLeadingSlashRemoved)) }
|
||||
}
|
||||
|
||||
func with<T>(relativePath: String, perform operation: (URL) -> T?) -> T? {
|
||||
perform { operation($0.appending(path: relativePath)) }
|
||||
perform { operation($0.appending(path: relativePath.withLeadingSlashRemoved)) }
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user