implement tags/foo
* tekuti/page.scm (page-show-tag): Implement, in a basic way.
This commit is contained in:
parent
c08973ca92
commit
1ec5fb27eb
1 changed files with 14 additions and 1 deletions
|
@ -210,7 +210,20 @@
|
||||||
(not-implemented request index))
|
(not-implemented request index))
|
||||||
|
|
||||||
(define (page-show-tag request index tag)
|
(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)
|
(define (page-debug request index)
|
||||||
(rcons* request
|
(rcons* request
|
||||||
|
|
Loading…
Reference in a new issue