commit
3692c57123
3 changed files with 8 additions and 12 deletions
|
@ -22,8 +22,7 @@
|
|||
(page-ext *config*))))
|
||||
(if (pathname-type result)
|
||||
result
|
||||
(make-pathname :type extension :defaults result)
|
||||
)))
|
||||
(make-pathname :type extension :defaults result))))
|
||||
|
||||
(defun page-path (object)
|
||||
"The path to store OBJECT at once rendered."
|
||||
|
|
|
@ -41,17 +41,16 @@ are in the plugins folder in coleslaw's source directory."
|
|||
(apply 'enable-plugin (plugin-path name) args)))))
|
||||
|
||||
(defun discover-config-path (&optional (path ""))
|
||||
"Checks the project directory for a coleslawrc and if one
|
||||
doesn't exist, uses the coleslawrc in the home directory."
|
||||
(let ((rel-path (make-pathname :directory path :name ".coleslawrc")))
|
||||
(if (file-exists-p rel-path)
|
||||
rel-path
|
||||
(make-pathname :directory (namestring (user-homedir-pathname)) :name ".coleslawrc"))))
|
||||
"Check the supplied PATH for a .coleslawrc and if one
|
||||
doesn't exist, use the .coleslawrc in the home directory."
|
||||
(let ((custom-path (rel-path path ".coleslawrc")))
|
||||
(if (file-exists-p custom-path)
|
||||
custom-path
|
||||
(rel-path (user-homedir-pathname) ".coleslawrc"))))
|
||||
|
||||
(defun load-config (config-key)
|
||||
"Load the coleslaw configuration from DIR/.coleslawrc, using CONFIG-KEY
|
||||
if necessary. DIR is ~ by default."
|
||||
|
||||
(with-open-file (in (discover-config-path config-key))
|
||||
(let ((config-form (read in)))
|
||||
(if (symbolp (car config-form))
|
||||
|
|
|
@ -13,9 +13,7 @@
|
|||
(setf (content-slug object) (slugify title)
|
||||
format (make-keyword (string-upcase format))
|
||||
text (render-content text format)
|
||||
author (if author
|
||||
author
|
||||
(author *config*)))))
|
||||
author (or author (author *config*)))))
|
||||
|
||||
(defmethod render ((object post) &key prev next)
|
||||
(funcall (theme-fn 'post) (list :config *config*
|
||||
|
|
Loading…
Add table
Reference in a new issue