summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--tekuti/page.scm15
1 files changed, 14 insertions, 1 deletions
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