summaryrefslogtreecommitdiffstatshomepage
path: root/tekuti
diff options
context:
space:
mode:
authorGravatar Andy Wingo2011-04-25 20:30:57 +0200
committerGravatar Andy Wingo2011-04-25 20:30:57 +0200
commitcee672f11721101ba3c03f8397691177a404c325 (patch)
treef0a2f881773f0afc3caadb6dee587181a6169d5a /tekuti
parent08e1e58f1f07229eda581ee3d82648c03ffa5691 (diff)
downloadtekuti-cee672f11721101ba3c03f8397691177a404c325.tar.gz
tekuti-cee672f11721101ba3c03f8397691177a404c325.zip
multiple with query args add tags to the set
* tekuti/page.scm (page-feed-atom): Reimplement more clearly, and give "with" inclusionary meaning.
Diffstat (limited to 'tekuti')
-rw-r--r--tekuti/page.scm38
1 files changed, 23 insertions, 15 deletions
diff --git a/tekuti/page.scm b/tekuti/page.scm
index dd3cc97..182ea02 100644
--- a/tekuti/page.scm
+++ b/tekuti/page.scm
@@ -343,22 +343,30 @@
(tags (assq-ref index 'tags))
(posts (assq-ref index 'posts))
(master (assq-ref index 'master)))
+ (define include?
+ (if (pair? with)
+ (fold (lambda (tag cont)
+ (let ((posts (hash-ref tags tag '())))
+ (lambda (post)
+ (or (member (post-key post) posts)
+ (cont post)))))
+ (lambda (post) #f)
+ with)
+ (lambda (post) #t)))
+ (define exclude?
+ (fold (lambda (tag cont)
+ (let ((posts (hash-ref tags tag '())))
+ (lambda (post)
+ (or (member (post-key post) posts)
+ (cont post)))))
+ (lambda (post) #f)
+ without))
+
(atom-feed-from-posts
request body index
- (filter-mapn (fold (lambda (tag cont)
- (let ((posts (hash-ref tags tag '())))
- (lambda (post)
- (and (not (member (post-key post) posts))
- (cont post)))))
- (fold (lambda (tag cont)
- (let ((posts (hash-ref tags tag '())))
- (lambda (post)
- (and (member (post-key post) posts)
- (cont post)))))
- (lambda (post)
- (and (post-published? post)
- post))
- with)
- without)
+ (filter-mapn (lambda (post)
+ (and (include? post) (not (exclude? post))
+ (post-published? post)
+ post))
posts
10))))