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

This commit is contained in:
Brit Butler 2012-09-13 09:20:30 -04:00
parent 27e8ed0590
commit f7a48d4a6e
4 changed files with 19 additions and 16 deletions

View file

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

View file

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

View file

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

View file

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