Commit 894298af authored by Philipp Marek's avatar Philipp Marek
Browse files

Merge branch 'less-rendering-output' into 'master'

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

See merge request clo/cl-site!83
parents a500af29 cf69367d
Pipeline #622 passed with stages
in 13 seconds
......@@ -51,23 +51,18 @@
(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)
;;;###TODO not happy about loading the lisp file; it defeats the preprocessor/postprocessor purpose
(load (merge-pathnames lisp-file *pages-dir*))
(let (*computed-page-content*)
(with-input-from-string (s content)
(load s))
(let ((headers (getf *computed-page-content* :headers)))
(call-next-hook (getf *computed-page-content* :html-string)
(append (mapcan #'(lambda (key value)
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