Updated the DocCMiddleware middleware in the library target to support hosting from docc archives.
This commit is contained in:
@@ -2,11 +2,19 @@ enum Path {
|
||||
|
||||
// MARK: Functions
|
||||
|
||||
static func archivePath(from path: String) -> String {
|
||||
let pathComponents = path.split(separator: .forwardSlash)
|
||||
|
||||
return pathComponents.count > 1
|
||||
? .init(format: .Format.archiveDocC, String(pathComponents[1]))
|
||||
: .empty
|
||||
}
|
||||
|
||||
static func archiveName(from path: String) -> String {
|
||||
let pathComponents = path.split(separator: .forwardSlash)
|
||||
|
||||
return pathComponents.count > 1
|
||||
? String(pathComponents[1]).lowercased()
|
||||
? .init(pathComponents[1]).lowercased()
|
||||
: .empty
|
||||
}
|
||||
|
||||
@@ -37,5 +45,5 @@ private extension Character {
|
||||
// MARK: - String+Formats
|
||||
|
||||
private extension String.Format {
|
||||
static let archiveDocC = "%@.doccarchive"
|
||||
static let archiveDocC = "/%@.doccarchive"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user