diff --git a/TODO b/TODO index e22d830..b48c0b3 100644 --- a/TODO +++ b/TODO @@ -3,35 +3,39 @@ Everything. Ideas: -- Replace cl-markdown with 3bmd down the line? -- Use cl-inotify or similar for notifications instead of timers? - -- plugins -> lastfm widget, analytics, rss/atom, disqus, akismet, etc. -;; TODO: -;; consider add-to-index/setf-index, create-index, create-post. -;; then ensure the indices API is okay and GET GOING. - -;;;; DYNAMIC +TODO: ;;;; STATIC ;;;; implement head-inject/body-inject/navigation! ;;;; implement start-coleslaw, stop-coleslaw! -;;;; non-disqus comment support? -;;; indexes +;;;; implement render-site!!! +;;;; implement atom feed. RSS too? +;;;; implement non-disqus comment support? +;;;; What do post update semantics look like? i.e. edit file to change tags. +;;; indices ;; what should it really look like, keeping in mind the API should be mostly ;; identical between the static and dynamic backend? +;; indexes should be id/name, title + posts. rewrite indices to use them. ;;; posts ;; Make find-by-date, post-url not suck. ;; -- re: find-by-date, aside from the subseq+string= grossness, the posts it ;; -- returns are not in reverse chronological order. Fix it! -;; -- re: post-url, escaping is insufficient and there are collisions by title. -;; -- What are alternatives? +;; -- re: post-url, improve escaping. ;;;; PLUGINS ;;;; implement: analytics, crossposting, disqus, mathjax, pygments, recaptcha, s3 +;;;; support input or output dirs being git repos + have git hooks? ;;; import ;; add output to HTML files when static-p is true ;; add comment handling ... (when comments ...) ;; support old URLs via use of post-aliases? +;;;; DYNAMIC +;;;; implement the whole damn backend! +;;;; make sure it has an admin interface! +;;;; -- spend two years trying to make it secure without HTTPS+SSL. fail. + ;;;; rendering hooks (pygmentize, xposting) via :around/:before/:after methods ;; get run on rendered html before "storage" ;; xposting may be a rendering hook but may necessitate publishing hooks diff --git a/coleslaw-static.asd b/coleslaw-static.asd index 4d9e64b..9a96b97 100644 --- a/coleslaw-static.asd +++ b/coleslaw-static.asd @@ -5,8 +5,14 @@ :maintainer "Brit Butler " :author "Brit Butler " :licence "LLGPL" - :depends-on (:coleslaw :zs3 :trivial-timers) + :depends-on (:coleslaw :zs3 :trivial-timers :cl-store) :components ((:module static :components ((:file "coleslaw") + (:file "comments" + :depends-on ("coleslaw")) (:file "posts" + :depends-on ("coleslaw")) + (:file "indices" + :depends-on ("posts")) + (:file "util" :depends-on ("coleslaw")))))) diff --git a/plugins/akismet.lisp b/plugins/akismet.lisp new file mode 100644 index 0000000..fb7f3d6 --- /dev/null +++ b/plugins/akismet.lisp @@ -0,0 +1,2 @@ +(in-package :coleslaw) + diff --git a/static/indices.lisp b/static/indices.lisp index 43fdc63..24e1cb2 100644 --- a/static/indices.lisp +++ b/static/indices.lisp @@ -2,21 +2,11 @@ (defun monthlinks () (loop for month in (gethash :months-index *storage*) - collect (cons (index-url :date month) month) into months - finally (return - (pretty-list (mapcar (lambda (consp) - (format nil "~a" - (car consp) (cdr consp))) - months))))) + collecting (list :url (index-url :date month) :name month))) (defun taglinks () (loop for tag in (gethash :tags-index *storage*) - collect (cons (index-url :tag tag) tag) into tags - finally (return - (pretty-list (mapcar (lambda (consp) - (format nil "~a" - (car consp) (cdr consp))) - tags))))) + collecting (list :url (index-url :tag tag) :name tag))) (defun index-title (id &optional page) (case id diff --git a/static/posts.lisp b/static/posts.lisp index 2793d93..b3c60b2 100644 --- a/static/posts.lisp +++ b/static/posts.lisp @@ -43,14 +43,14 @@ (push post results))) results)) -(defmethod find-by-date (date) +(defmethod find-by-date (year-month) (let ((results nil) - (year (parse-integer (subseq date 0 4))) - (month (parse-integer (subseq date 5)))) + (year (parse-integer (subseq year-month 0 4))) + (month (parse-integer (subseq year-month 5)))) (loop for post being the hash-values in (gethash :posts *storage*) - do (let ((post-date (post-date post))) - (when (and (= year (local-time:timestamp-year post-date)) - (= month (local-time:timestamp-month post-date))) + do (let ((date (post-date post))) + (when (and (= year (local-time:timestamp-year date)) + (= month (local-time:timestamp-month date))) (push post results)))) results)) @@ -62,4 +62,7 @@ (defmethod post-url (id) (flet ((escape (str) (substitute #\- #\Space str))) - (concatenate 'string *site-root* "/" (escape (post-title (find-post id)))))) + (let ((post (find-post id))) + (concatenate 'string *site-root* "/" + (year-month (post-date post)) "/" + (escape (post-title post)))))) diff --git a/static/util.lisp b/static/util.lisp index 41e2759..f2cb7aa 100644 --- a/static/util.lisp +++ b/static/util.lisp @@ -6,5 +6,9 @@ (defun pretty-list (list) (format nil "~{~A~^, ~}" list)) +(defun year-month (date) + (format nil "~4d-~2,'0d" (local-time:timestamp-year date) + (local-time:timestamp-month date))) + (defun theme-fn (name) (find-symbol name (theme-package))) diff --git a/themes/hyde/index.tmpl b/themes/hyde/index.tmpl index c3652d0..7a216e3 100644 --- a/themes/hyde/index.tmpl +++ b/themes/hyde/index.tmpl @@ -3,12 +3,20 @@ {template index} {if $taglinks}
-

This blog covers {$taglinks |noAutoescape} +

This blog covers + {foreach $taglink in $taglinks} + {$taglink.name} + {if not isLast($taglink)}, {/if} + {/foreach}

{/if} {if $monthlinks}
-

View posts from {$monthlinks |noAutoescape} +

View posts from + {foreach $monthlink in $monthlinks} + {$monthlink.name} + {if not isLast($monthlink)}, {/if} + {/foreach}

{/if}

{$title}