;; Why templates need to be functions ;; ---------------------------------- ;; The short answer is two-fold: ;; - they need to defer computation ;; - they need to operate on paramaterized pages ;; Here's what a template might look like: ;; (don't worry about with-html-string, it should be clear what it ;; does from context (i hope)) .. also idk what's going on with the indentation (lambda (page) (with-html-string (:doctype) (:html (:head (:title (page-title page))) (:body (:h1 (page-title page)) (:raw (page-content page)))))) ;; see how the page must be parameterized in the string, or it doesn't work ;; okay actually, right now i have a little function that walks to convert ;; :page-title into (page-title page) and etc... so maybe i could make it so you ;; would just (defvar page-template '((:doctype) (:html (:head (:title :page-title)) (:body (:h1 :page-title) (:raw :page-content))))) (defun apply-template (template page) ...) ;; though with-html-string is a macro, which makes things a little trickier ;; still, that's my thinking. thoughts?