Bläddra i källkod

Compilation works. Now to fix the deploy...

Brit Butler 13 år sedan
förälder
incheckning
8787fa0f21
4 ändrade filer med 9 tillägg och 9 borttagningar
  1. 1 4
      TODO
  2. 6 2
      src/coleslaw.lisp
  3. 2 2
      src/indices.lisp
  4. 0 1
      src/packages.lisp

+ 1 - 4
TODO

@@ -13,13 +13,10 @@ Plugins? Injection support for HEAD and BODY. What about predicate-based injecti
13 13
 How is it served? Hunchentoot, Lighttpd, S3, whomever!
14 14
 
15 15
 TODO:
16
-; blockers to use this for redlinernotes: rss/atom feed, markdown support
16
+; blockers to use this for redlinernotes: prev/next, rss/atom feed, markdown support
17 17
 ; after that, focus on injections for code highlighting and latex
18 18
 
19 19
 ; doc themes and plugins
20
-; populate prev and next links
21
-; implement plugins: atom, markdown, pygment/highlighting
22
-; actually start using this for redlinernotes.com? Move over May-2007 to present.
23 20
 ; fix plugins: s3
24 21
 ;; Incremental compile: only "touched" posts+tags+months. By-20 must be redone, of course.
25 22
 ;; ^^ Long as we're overhauling, maybe come up with a commithook scheme that runs main

+ 6 - 2
src/coleslaw.lisp

@@ -5,10 +5,14 @@
5 5
 If ARGS is provided, use (apply 'format nil PATH ARGS) as the value of PATH."
6 6
   (merge-pathnames (apply 'format nil path args) coleslaw-conf:*basedir*))
7 7
 
8
-(defun to-pathname (file parent)
8
+(defun to-pathname (file &optional (parent coleslaw-conf:*basedir*))
9 9
   "Convert an iolib file-path back to a pathname."
10 10
   (merge-pathnames (file-path-namestring file) parent))
11 11
 
12
+(defun read-symlink (path)
13
+  "A trivial wrapper over iolib.os that returns the pathname in the symlink PATH."
14
+  (to-pathname (iolib.os:read-symlink path)))
15
+
12 16
 (defmacro do-files ((var path &optional extension) &body body)
13 17
   "For each file under PATH, run BODY. If EXTENSION is provided, only run BODY
14 18
 on files that match the given extension."
@@ -67,7 +71,7 @@ on files that match the given extension."
67 71
   (:documentation "Deploy DIR, updating the .prev and .curr symlinks.")
68 72
   (:method (dir)
69 73
     (let ((new-build (app-path "generated/~a" (get-universal-time))))
70
-      (run-program "mv" (list dir (namestring new-build)))
74
+      (run-program "mv" (mapcar #'namestring (list dir new-build)))
71 75
       (when (probe-file (app-path ".prev"))
72 76
         (delete-directory-and-files (read-symlink (app-path ".prev"))))
73 77
       (when (probe-file (app-path ".curr"))

+ 2 - 2
src/indices.lisp

@@ -55,8 +55,8 @@
55 55
   "Render the indices to view posts by tag."
56 56
   (loop for tag in (all-tags)
57 57
      do (flet ((match-tag (post)
58
-                 (member tag post :test #'string= :key #'post-tags)))
59
-          (let ((posts (remove-if-not #'match-tag posts)))
58
+                 (member tag (post-tags post) :test #'string=)))
59
+          (let ((posts (remove-if-not #'match-tag (hash-table-values *posts*))))
60 60
             (write-index posts (format nil "tag/~a.html" tag)
61 61
                          (format nil "Posts tagged ~a" tag))))))
62 62
 

+ 0 - 1
src/packages.lisp

@@ -3,7 +3,6 @@
3 3
   (:import-from :cl-fad #:delete-directory-and-files
4 4
                         #:list-directory)
5 5
   (:import-from :iolib.os #:with-current-directory
6
-                          #:read-symlink
7 6
                           #:run-program)
8 7
   (:import-from :iolib.pathnames #:file-path-namestring)
9 8
   (:import-from :alexandria #:hash-table-values