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