feat: Working on layout / css.

This commit is contained in:
2025-01-15 14:31:36 -05:00
parent cf28e52fa2
commit 24570e7191
15 changed files with 285 additions and 118 deletions

View File

@@ -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 }
}
}