Add :partial option to renderer

This commit is contained in:
Akira Tempaku 2025-05-03 08:18:51 +09:00
parent e4b7303d5b
commit d7f5a39fc8
Signed by: paku
GPG key ID: 5B4E8402BCC50607

View file

@ -24,14 +24,16 @@
(defmethod jingle:process-response ((app jingle:app) result)
(set-response-header :content-type "text/html; charset=utf-8")
(call-next-method app
(hsx:render-to-string
(match result
((plist :body body
:metadata metadata
:cache cache)
(progn
(set-cache-control cache)
(~layout :metadata metadata
body)))
(_ (error "Invalid response form"))))))
(match result
((plist :body body
:metadata metadata
:cache cache
:partial partial)
(set-cache-control cache)
(call-next-method app
(hsx:render-to-string
(if partial
body
(~layout :metadata metadata
body)))))
(_ (error "Invalid response form"))))