From 387e47bde6f6f4f899f8245ef7bf4e5d9e843be2 Mon Sep 17 00:00:00 2001 From: Brit Butler Date: Sat, 22 Mar 2014 18:08:47 -0400 Subject: [PATCH 1/3] Use OR to guard instead of IF. --- src/posts.lisp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/posts.lisp b/src/posts.lisp index baacf15..24f37de 100644 --- a/src/posts.lisp +++ b/src/posts.lisp @@ -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* From 5ce88c48f57fd5b8867d6e499fa890615af9b82e Mon Sep 17 00:00:00 2001 From: Brit Butler Date: Sat, 22 Mar 2014 18:09:52 -0400 Subject: [PATCH 2/3] Fix dangling parentheses. --- src/coleslaw.lisp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/coleslaw.lisp b/src/coleslaw.lisp index 48f6fb8..e8e0c7e 100644 --- a/src/coleslaw.lisp +++ b/src/coleslaw.lisp @@ -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." From 9a3fc1ee3244c40d1cc956e1caa6de800a6a5381 Mon Sep 17 00:00:00 2001 From: Brit Butler Date: Sun, 23 Mar 2014 13:04:22 -0400 Subject: [PATCH 3/3] Use REL-PATH instead of make-pathname in DISCOVER-CONFIG-PATH. --- src/config.lisp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/config.lisp b/src/config.lisp index 074daef..ad2304e 100644 --- a/src/config.lisp +++ b/src/config.lisp @@ -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))