From 8787fa0f21a97dbedc75881248dd62c90c2d54ff Mon Sep 17 00:00:00 2001 From: Brit Butler Date: Tue, 21 Aug 2012 19:48:41 -0400 Subject: [PATCH] Compilation works. Now to fix the deploy... --- TODO | 5 +---- src/coleslaw.lisp | 8 ++++++-- src/indices.lisp | 4 ++-- src/packages.lisp | 1 - 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/TODO b/TODO index 9e00323..dbcc304 100644 --- a/TODO +++ b/TODO @@ -13,13 +13,10 @@ Plugins? Injection support for HEAD and BODY. What about predicate-based injecti How is it served? Hunchentoot, Lighttpd, S3, whomever! TODO: -; blockers to use this for redlinernotes: rss/atom feed, markdown support +; blockers to use this for redlinernotes: prev/next, rss/atom feed, markdown support ; after that, focus on injections for code highlighting and latex ; doc themes and plugins -; populate prev and next links -; implement plugins: atom, markdown, pygment/highlighting -; actually start using this for redlinernotes.com? Move over May-2007 to present. ; fix plugins: s3 ;; Incremental compile: only "touched" posts+tags+months. By-20 must be redone, of course. ;; ^^ Long as we're overhauling, maybe come up with a commithook scheme that runs main diff --git a/src/coleslaw.lisp b/src/coleslaw.lisp index 8125a1e..ccf01c8 100644 --- a/src/coleslaw.lisp +++ b/src/coleslaw.lisp @@ -5,10 +5,14 @@ If ARGS is provided, use (apply 'format nil PATH ARGS) as the value of PATH." (merge-pathnames (apply 'format nil path args) coleslaw-conf:*basedir*)) -(defun to-pathname (file parent) +(defun to-pathname (file &optional (parent coleslaw-conf:*basedir*)) "Convert an iolib file-path back to a pathname." (merge-pathnames (file-path-namestring file) parent)) +(defun read-symlink (path) + "A trivial wrapper over iolib.os that returns the pathname in the symlink PATH." + (to-pathname (iolib.os:read-symlink path))) + (defmacro do-files ((var path &optional extension) &body body) "For each file under PATH, run BODY. If EXTENSION is provided, only run BODY on files that match the given extension." @@ -67,7 +71,7 @@ on files that match the given extension." (:documentation "Deploy DIR, updating the .prev and .curr symlinks.") (:method (dir) (let ((new-build (app-path "generated/~a" (get-universal-time)))) - (run-program "mv" (list dir (namestring new-build))) + (run-program "mv" (mapcar #'namestring (list dir new-build))) (when (probe-file (app-path ".prev")) (delete-directory-and-files (read-symlink (app-path ".prev")))) (when (probe-file (app-path ".curr")) diff --git a/src/indices.lisp b/src/indices.lisp index 1d6093d..37d6814 100644 --- a/src/indices.lisp +++ b/src/indices.lisp @@ -55,8 +55,8 @@ "Render the indices to view posts by tag." (loop for tag in (all-tags) do (flet ((match-tag (post) - (member tag post :test #'string= :key #'post-tags))) - (let ((posts (remove-if-not #'match-tag posts))) + (member tag (post-tags post) :test #'string=))) + (let ((posts (remove-if-not #'match-tag (hash-table-values *posts*)))) (write-index posts (format nil "tag/~a.html" tag) (format nil "Posts tagged ~a" tag)))))) diff --git a/src/packages.lisp b/src/packages.lisp index 7ce3d0e..112b3ec 100644 --- a/src/packages.lisp +++ b/src/packages.lisp @@ -3,7 +3,6 @@ (:import-from :cl-fad #:delete-directory-and-files #:list-directory) (:import-from :iolib.os #:with-current-directory - #:read-symlink #:run-program) (:import-from :iolib.pathnames #:file-path-namestring) (:import-from :alexandria #:hash-table-values