Kaynağa Gözat

Minor tweaks to PREVIEW.

Brit Butler 12 yıl önce
ebeveyn
işleme
da219abe4f
1 değiştirilmiş dosya ile 5 ekleme ve 4 silme
  1. 5 4
      src/coleslaw.lisp

+ 5 - 4
src/coleslaw.lisp

@@ -82,10 +82,11 @@ compile and deploy the blog."
82 82
   (deploy (staging *config*)))
83 83
 
84 84
 (defun preview (path &optional (content-type 'post))
85
-  "Render the content at PATH and save it to ~/tmp.html, loading the
86
-user's config and theme if necessary."
85
+  "Render the content at PATH under user's configured repo and save it to
86
+~/tmp.html. Load the user's config and theme if necessary."
87 87
   (unless *config*
88 88
     (load-config nil)
89 89
     (compile-theme (theme *config*)))
90
-  (let ((object (construct content-type (read-content path))))
91
-    (write-page "~/tmp.html" (render-page object))))
90
+  (let* ((file (rel-path (repo *config*) path))
91
+         (content (construct content-type (read-content file))))
92
+    (write-page "~/tmp.html" (render-page content))))