2025-05-02 09:39:55 +09:00
|
|
|
(defpackage #:website/renderer
|
2024-06-15 21:59:15 +09:00
|
|
|
(:use #:cl
|
2024-11-16 01:52:01 +09:00
|
|
|
#:hsx
|
2025-05-04 00:26:49 +09:00
|
|
|
#:jingle)
|
2024-11-16 01:52:01 +09:00
|
|
|
(:import-from #:hsx/element
|
2025-03-29 12:01:07 +09:00
|
|
|
#:element)
|
2025-05-03 20:12:31 +09:00
|
|
|
(:import-from #:website/components/metadata
|
2025-05-03 23:36:01 +09:00
|
|
|
#:~metadata)
|
|
|
|
(:import-from #:website/components/scripts
|
|
|
|
#:~scripts)
|
|
|
|
(:import-from #:website/components/layout
|
|
|
|
#:~layout))
|
2025-05-02 09:39:55 +09:00
|
|
|
(in-package #:website/renderer)
|
2024-06-01 22:21:15 +09:00
|
|
|
|
2025-05-07 09:05:58 +09:00
|
|
|
(defmethod jingle:process-response :around ((app jingle:app) result)
|
2025-03-29 14:48:36 +09:00
|
|
|
(set-response-header :content-type "text/html; charset=utf-8")
|
2025-05-04 00:38:07 +09:00
|
|
|
(when (eq (request-method *request*) :get)
|
2025-05-04 15:21:25 +09:00
|
|
|
(set-response-header :cache-control "public, max-age=60"))
|
2025-05-04 00:26:49 +09:00
|
|
|
(call-next-method app
|
2025-05-04 00:38:07 +09:00
|
|
|
(render-to-string
|
2025-05-04 00:26:49 +09:00
|
|
|
(hsx (html :lang "ja"
|
|
|
|
(head
|
|
|
|
(~metadata :metadata (context :metadata))
|
|
|
|
(~scripts))
|
|
|
|
(body
|
2025-05-04 01:35:09 +09:00
|
|
|
:hx-ext "head-support, response-targets, preload"
|
2025-05-04 15:21:25 +09:00
|
|
|
:hx-boost "true" :hx-swap "transition:true"
|
|
|
|
:hx-target-404 "body" :hx-target-5* "body"
|
2025-05-04 00:26:49 +09:00
|
|
|
(~layout result)))))))
|