1
0
Fork 0

implement tags/foo

* tekuti/page.scm (page-show-tag): Implement, in a basic way.
This commit is contained in:
Andy Wingo 2008-03-02 16:49:11 +01:00
parent c08973ca92
commit 1ec5fb27eb

View file

@ -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