Kaynağa Gözat

Minor fixes to RENDER-FEEDS, example config, base template.

Brit Butler 12 yıl önce
ebeveyn
işleme
f7a48d4a6e
4 değiştirilmiş dosya ile 19 ekleme ve 16 silme
  1. 5 5
      example.coleslawrc
  2. 1 1
      src/config.lisp
  3. 11 8
      src/feeds.lisp
  4. 2 2
      themes/hyde/base.tmpl

+ 5 - 5
example.coleslawrc

@@ -4,10 +4,10 @@
4 4
  :feeds ("lisp")
5 5
  :plugins (mathjax)
6 6
  :repo "/home/git/tmp/improvedmeans/"
7
- :sitenav (:url "http://redlinernotes.com/" :name "Home"
8
-           :url "http://twitter.com/redline6561" :name "Twitter"
9
-           :url "http://github.com/redline6561" :name "Code"
10
-           :url "http://soundcloud.com/redlinernotes" :name "Music"
11
-           :url "http://redlinernotes.com/docs/talks/" :name "Talks")
7
+ :sitenav ((:url "http://redlinernotes.com/" :name "Home")
8
+           (:url "http://twitter.com/redline6561" :name "Twitter")
9
+           (:url "http://github.com/redline6561" :name "Code")
10
+           (:url "http://soundcloud.com/redlinernotes" :name "Music")
11
+           (:url "http://redlinernotes.com/docs/talks/" :name "Talks"))
12 12
  :title "Improved Means for Achieving Deteriorated Ends"
13 13
  :theme "hyde")

+ 1 - 1
src/config.lisp

@@ -5,7 +5,7 @@
5 5
    (deploy :initarg :deploy :initform nil :accessor deploy)
6 6
    (domain :initarg :domain :initform "" :accessor domain)
7 7
    (feeds :initarg :feeds :initform nil :accessor feeds)
8
-   (license :initarg :license :initform "CC-BY-SA" :accessor license)
8
+   (license :initarg :license :initform nil :accessor license)
9 9
    (plugins :initarg :plugins :initform '() :accessor plugins)
10 10
    (repo :initarg :repo :initform #p"/" :accessor repo)
11 11
    (sitenav :initarg :sitenav :initform "" :accessor sitenav)

+ 11 - 8
src/feeds.lisp

@@ -17,11 +17,14 @@
17 17
 
18 18
 (defun render-feeds (feeds)
19 19
   "Render and write the given FEEDS for the site."
20
-  (let* ((by-date (by-date (hash-table-values *posts*)))
21
-         (posts (subseq by-date 0 (min (length by-date) 10))))
22
-    (render-page (make-instance 'index :path "rss.xml" :posts posts) :rss)
23
-    (render-page (make-instance 'index :path "feed.atom" :posts posts) :atom)
24
-    (dolist (feed feeds)
25
-      (let ((index (index-by-tag feed by-tag)))
26
-        (setf (index-path index) (format nil "tag/~a-rss.xml" feed))
27
-        (render-page index :rss)))))
20
+  (flet ((first-10 (list)
21
+           (subseq list 0 (min (length list) 10))))
22
+    (let* ((by-date (by-date (hash-table-values *posts*)))
23
+           (posts (first-10 by-date)))
24
+      (render-page (make-instance 'index :path "rss.xml" :posts posts) :rss)
25
+      (render-page (make-instance 'index :path "feed.atom" :posts posts) :atom)
26
+      (dolist (feed feeds)
27
+        (let ((index (index-by-tag feed by-date)))
28
+          (setf (index-path index) (format nil "tag/~a-rss.xml" feed)
29
+                (index-posts index) (first-10 (index-posts index)))
30
+          (render-page index :rss))))))

+ 2 - 2
themes/hyde/base.tmpl

@@ -14,11 +14,11 @@
14 14
   </head>
15 15
   <body>
16 16
     <div class="navigation">
17
+      <a href="{$config.domain}">{$config.title}</a> |
17 18
       {foreach $link in $config.sitenav}
18 19
         <a href="{$link.url}">{$link.name}</a>
19
-        {sp} | {sp}
20
+        {if not isLast($link)} | {/if}
20 21
       {/foreach}
21
-      <a href="{$config.domain}">{$config.title}</a>
22 22
     </div>
23 23
     <div id="content">
24 24
       {$raw |noAutoescape}