Sfoglia il codice sorgente

Add some static-specific vars, DWIMfix to find-by-range, update .gitignore, small post template improvement.

Brit Butler 14 anni fa
parent
commit
bbe06ffe4d
5 ha cambiato i file con 34 aggiunte e 6 eliminazioni
  1. 2 0
      .gitignore
  2. 5 3
      TODO
  3. 22 0
      static/coleslaw.lisp
  4. 3 1
      static/posts.lisp
  5. 2 2
      themes/hyde/post.tmpl

+ 2 - 0
.gitignore

@@ -1,2 +1,4 @@
1 1
 *~
2 2
 *.fasl
3
+ignore/
4
+generated/

+ 5 - 3
TODO

@@ -12,9 +12,12 @@ Ideas:
12 12
 ;;;; DYNAMIC
13 13
 
14 14
 ;;;; STATIC
15
-;;;; implement *output-dir*, render-site.
15
+;;;; implement render-site, head-inject/body-inject/navigation.
16
+;;;; non-disqus comment support?
16 17
 ;;; posts
17 18
 ;; Make find-by-date, post-url not suck.
19
+;; -- re: post-url, escaping is insufficient and there are collisions by title.
20
+;; -- What are alternatives?
18 21
 
19 22
 ;;;; PLUGINS
20 23
 ;;;; implement disqus support
@@ -22,8 +25,7 @@ Ideas:
22 25
 ;; add comment handling ... (when comments ...)
23 26
 ;; support old URLs via use of post-aliases?
24 27
 
25
-;;;; rendering hooks (eg. :pygmentize, :xpost-lj?)
26
-;; may need pre- and post- but for now stick to post-.
28
+;;;; rendering hooks (pygmentize, xposting) via :around/:before/:after methods
27 29
 ;; get run on rendered html before "storage"
28 30
 ;; xposting may be a rendering hook but may necessitate publishing hooks
29 31
 ;; again, these should be methods on a generic function

+ 22 - 0
static/coleslaw.lisp

@@ -1,5 +1,27 @@
1 1
 (in-package :coleslaw)
2 2
 
3
+(defvar *site-root* nil
4
+  "A string representing the base URL of the site,
5
+e.g. \"http://blog.redlinernotes.com/\".")
6
+
7
+(defvar *site-title* nil
8
+  "A string containing the title of the site,
9
+e.g. \"Improved Means for Achieving Deterioriated Ends\".")
10
+
11
+(defvar *site-credits* nil
12
+  "A string containing the credits of the site,
13
+e.g. \"Brit Butler (year)\".")
14
+
15
+(defvar *site-license* nil
16
+  "A string containing the (optional) license of the site,
17
+e.g. \"CC-BY-SA\". Otherwise, standard copyright is assumed.")
18
+
19
+(defvar *output-directory* nil
20
+  "The path where the compiled coleslaw site will be output.")
21
+
22
+(defvar *input-directory* nil
23
+  "The directory which will be watched for new posts.")
24
+
3 25
 (defun static-init ()
4 26
   (setf *storage* (make-hash-table))
5 27
   (loop for table in '(:authors :comments :posts :indices :credentials)

+ 3 - 1
static/posts.lisp

@@ -57,7 +57,9 @@
57 57
     results))
58 58
 
59 59
 (defmethod find-by-range (start end)
60
-  (loop for id from start upto end collecting (find-post id)))
60
+  (if (> start end)
61
+      (loop for id from start downto end collecting (find-post id))
62
+      (loop for id from start upto end collecting (find-post id))))
61 63
 
62 64
 (defmethod post-url (id)
63 65
   (flet ((escape (str)

+ 2 - 2
themes/hyde/post.tmpl

@@ -14,8 +14,8 @@
14 14
   {$content |noAutoescape}
15 15
 </div>{\n}
16 16
 <div class="relative-nav">{\n}
17
-  {if $prev} <a href="{$prev}">Previous</a> {/if}
18
-  {if $next} <a href="{$next}">Next</a> {/if}
17
+  {if $prev} <a href="{$prev}">Previous</a><br> {/if}{\n}
18
+  {if $next} <a href="{$next}">Next</a><br> {/if}{\n}
19 19
 </div>{\n}
20 20
 {if $comments}
21 21
   <div class="comments">{$comments |noAutoescape}</div>