feat: Working on layout / css.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import Elementary
|
||||
import Vapor
|
||||
import VaporElementary
|
||||
|
||||
extension Request {
|
||||
func ensureValidContent<T>(_ decoding: T.Type) throws -> T where T: Content, T: Validatable {
|
||||
@@ -19,4 +21,11 @@ extension Request {
|
||||
var isHtmxRequest: Bool {
|
||||
headers.contains(name: "hx-request")
|
||||
}
|
||||
|
||||
func render<C: HTML>(
|
||||
@HTMLBuilder html: () async throws -> C
|
||||
) async rethrows -> HTMLResponse where C: Sendable {
|
||||
let html = try await html()
|
||||
return HTMLResponse { html }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user