This PR contains the latest updates from the generic Website template, which have been added while working on #loud-amsterdam. Reviewed-on: #1 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
26 lines
801 B
Swift
26 lines
801 B
Swift
import Foundation
|
|
import Infrastructure
|
|
|
|
public extension NotFoundMiddleware {
|
|
|
|
// MARK: Initializers
|
|
|
|
/// Creates a not-found middleware that renders the website's not-found page, localized to the module's String Catalog languages.
|
|
/// - Parameters:
|
|
/// - assetVersion: the version token appended to the page's asset URLs, or `nil` (the default) to leave them unversioned.
|
|
/// - analytics: the analytics tracker the page embeds, or `nil` (the default) to omit the tracker script.
|
|
init(
|
|
assetVersion: String? = nil,
|
|
analytics: Analytics? = nil
|
|
) {
|
|
self.init(bundle: .module) {
|
|
NotFoundPage(
|
|
locale: $0,
|
|
assetVersion: assetVersion,
|
|
analytics: analytics
|
|
)
|
|
}
|
|
}
|
|
|
|
}
|