Implemented (a first version of) the DocCMiddleware middleware in the library target.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
enum AssetPrefix: String, CaseIterable {
|
||||
case css
|
||||
case data
|
||||
case downloads
|
||||
case images
|
||||
case img
|
||||
case index
|
||||
case js
|
||||
case videos
|
||||
}
|
||||
|
||||
// MARK: - Pathable
|
||||
|
||||
extension AssetPrefix: Pathable {
|
||||
|
||||
// MARK: Computed
|
||||
|
||||
var path: String {
|
||||
.init(format: .Format.pathRoot, rawValue)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
enum IndexPrefix: String, CaseIterable {
|
||||
case documentation
|
||||
case tutorials
|
||||
}
|
||||
|
||||
// MARK: - Pathable
|
||||
|
||||
extension IndexPrefix: Pathable {
|
||||
|
||||
// MARK: Computed
|
||||
|
||||
var path: String {
|
||||
.init(format: .Format.pathRoot, rawValue)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
enum StaticFile: String, CaseIterable {
|
||||
case documentation = "documentation.json"
|
||||
case faviconICO = "favicon.ico"
|
||||
case faviconSVG = "favicon.svg"
|
||||
case themeSettings = "theme-settings.json"
|
||||
}
|
||||
|
||||
// MARK: - Pathable
|
||||
|
||||
extension StaticFile: Pathable {
|
||||
|
||||
// MARK: Computed
|
||||
|
||||
var path: String {
|
||||
switch self {
|
||||
case .documentation: "/data/" + rawValue
|
||||
default: .init(format: .Format.pathRoot, rawValue)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user