Commit f5b89fe1 authored by Erik Huelsmann's avatar Erik Huelsmann
Browse files

Pre- and post-processing are part of rendering (no extra output)

parent 7eac1061
......@@ -51,21 +51,16 @@
(let* ((md-file (enough-namestring (make-path *pages-dir* context t) *pages-dir*)))
(unless (string= (pathname-type md-file) "md")
(return-from preprocess-md-page (call-next-hook content context)))
(let ((html-file (make-pathname :defaults md-file :type "html")))
(format t "Transforming ~A to ~A~%" md-file html-file)
(let ((md-content (with-output-to-string
(cl-markdown:markdown content :stream out))))
(call-next-hook md-content context)))))
(let ((md-content (with-output-to-string
(cl-markdown:markdown content :stream out))))
(call-next-hook md-content context))))
(def-render-hook preprocess-lisp-page (content context)
(let* ((lisp-file (make-path *pages-dir* context t)))
(unless (string= (pathname-type lisp-file) "lisp")
(return-from preprocess-lisp-page (call-next-hook content context)))
(let ((html-file (enough-namestring (make-pathname :defaults lisp-file :type "html") *pages-dir*))
(format t "Loading ~a and creating fresh ~a...~%"
(file-namestring lisp-file) html-file)
(let (*computed-page-content*)
;;;###TODO not happy about loading the lisp file; it defeats the preprocessor/postprocessor purpose
(load (merge-pathnames lisp-file *pages-dir*))
(let ((headers (getf *computed-page-content* :headers)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment