Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 32s
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
27 lines
808 B
Plaintext
27 lines
808 B
Plaintext
;; content-on-sx — full HTML page wrapper.
|
|
;;
|
|
;; content/page composes the metadata + render layers into the shippable
|
|
;; artifact the blog serves: a minimal valid HTML5 document with an escaped
|
|
;; <title> (from doc metadata, falling back to the id) and the rendered blocks
|
|
;; as the body.
|
|
;;
|
|
;; Requires (loaded by harness): doc.sx, render.sx (asHTML + htmlEscaped),
|
|
;; meta.sx (doc-title).
|
|
|
|
(define ct-html-escape (fn (s) (str (st-send s "htmlEscaped" (list)))))
|
|
|
|
(define
|
|
content/page-title
|
|
(fn (doc) (let ((t (doc-title doc))) (if (= t nil) (doc-id doc) t))))
|
|
|
|
(define
|
|
content/page
|
|
(fn
|
|
(doc)
|
|
(str
|
|
"<!doctype html><html><head><meta charset=\"utf-8\"><title>"
|
|
(ct-html-escape (content/page-title doc))
|
|
"</title></head><body>"
|
|
(asHTML doc)
|
|
"</body></html>")))
|