From 1ec5fb27ebfc50a7e0c6cd181cd6d8d93b225368 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sun, 2 Mar 2008 16:49:11 +0100 Subject: implement tags/foo * tekuti/page.scm (page-show-tag): Implement, in a basic way. --- tekuti/page.scm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tekuti/page.scm b/tekuti/page.scm index 394ed30..318759a 100644 --- a/tekuti/page.scm +++ b/tekuti/page.scm @@ -210,7 +210,20 @@ (not-implemented request index)) (define (page-show-tag request index tag) - (not-implemented request index)) + (let* ((tags (assq-ref index 'tags)) + (posts (map (lambda (key) + (post-from-key (assq-ref index 'master) key)) + (hash-ref tags tag '())))) + (if (pair? posts) + (rcons* request + 'title (string-append "posts tagged \"" tag "\"") + 'body `((h2 "posts tagged \"" ,tag "\"") + ,@(map (lambda (post) `(p ,(post-link post))) + posts))) + (rcons* request + 'status 404 + 'body `((h2 "Unknown tag " ,tag) + (p "No posts were found tagged as \"" ,tag "\".")))))) (define (page-debug request index) (rcons* request -- cgit v1.2.3-54-g00ecf