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") :feeds ("lisp")
:plugins (mathjax) :plugins (mathjax)
:repo "/home/git/tmp/improvedmeans/" :repo "/home/git/tmp/improvedmeans/"
:sitenav (:url "http://redlinernotes.com/" :name "Home" :sitenav ((:url "http://redlinernotes.com/" :name "Home")
:url "http://twitter.com/redline6561" :name "Twitter" (:url "http://twitter.com/redline6561" :name "Twitter")
:url "http://github.com/redline6561" :name "Code" (:url "http://github.com/redline6561" :name "Code")
:url "http://soundcloud.com/redlinernotes" :name "Music" (:url "http://soundcloud.com/redlinernotes" :name "Music")
:url "http://redlinernotes.com/docs/talks/" :name "Talks") (:url "http://redlinernotes.com/docs/talks/" :name "Talks"))
:title "Improved Means for Achieving Deteriorated Ends" :title "Improved Means for Achieving Deteriorated Ends"
:theme "hyde") :theme "hyde")

View file

@ -5,7 +5,7 @@
(deploy :initarg :deploy :initform nil :accessor deploy) (deploy :initarg :deploy :initform nil :accessor deploy)
(domain :initarg :domain :initform "" :accessor domain) (domain :initarg :domain :initform "" :accessor domain)
(feeds :initarg :feeds :initform nil :accessor feeds) (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) (plugins :initarg :plugins :initform '() :accessor plugins)
(repo :initarg :repo :initform #p"/" :accessor repo) (repo :initarg :repo :initform #p"/" :accessor repo)
(sitenav :initarg :sitenav :initform "" :accessor sitenav) (sitenav :initarg :sitenav :initform "" :accessor sitenav)

View file

@ -17,11 +17,14 @@
(defun render-feeds (feeds) (defun render-feeds (feeds)
"Render and write the given FEEDS for the site." "Render and write the given FEEDS for the site."
(let* ((by-date (by-date (hash-table-values *posts*))) (flet ((first-10 (list)
(posts (subseq by-date 0 (min (length by-date) 10)))) (subseq list 0 (min (length list) 10))))
(render-page (make-instance 'index :path "rss.xml" :posts posts) :rss) (let* ((by-date (by-date (hash-table-values *posts*)))
(render-page (make-instance 'index :path "feed.atom" :posts posts) :atom) (posts (first-10 by-date)))
(dolist (feed feeds) (render-page (make-instance 'index :path "rss.xml" :posts posts) :rss)
(let ((index (index-by-tag feed by-tag))) (render-page (make-instance 'index :path "feed.atom" :posts posts) :atom)
(setf (index-path index) (format nil "tag/~a-rss.xml" feed)) (dolist (feed feeds)
(render-page index :rss))))) (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> </head>
<body> <body>
<div class="navigation"> <div class="navigation">
<a href="{$config.domain}">{$config.title}</a> |
{foreach $link in $config.sitenav} {foreach $link in $config.sitenav}
<a href="{$link.url}">{$link.name}</a> <a href="{$link.url}">{$link.name}</a>
{sp} | {sp} {if not isLast($link)} | {/if}
{/foreach} {/foreach}
<a href="{$config.domain}">{$config.title}</a>
</div> </div>
<div id="content"> <div id="content">
{$raw |noAutoescape} {$raw |noAutoescape}