summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2013-04-03 03:16:02 +0200
committerGravatar Tom Willemsen2013-04-03 03:16:02 +0200
commitea8c3a56421f734d12d5574a581dbbc451569706 (patch)
tree358a820aebf9eea1522322727a66947464753459
parenta08ae0c9a77d315cffc1e7101a17acbb1eaa71df (diff)
downloadtekuti-ea8c3a56421f734d12d5574a581dbbc451569706.tar.gz
tekuti-ea8c3a56421f734d12d5574a581dbbc451569706.zip
Make tag page look more like index
Blurr the distinction between the index page and a tag page so that tag pages may be used as stand-alone pages.
-rw-r--r--tekuti/page-helpers.scm13
-rw-r--r--tekuti/page.scm11
2 files changed, 16 insertions, 8 deletions
diff --git a/tekuti/page-helpers.scm b/tekuti/page-helpers.scm
index ab0a5e7..27f989a 100644
--- a/tekuti/page-helpers.scm
+++ b/tekuti/page-helpers.scm
@@ -43,7 +43,7 @@
post-url
post-editing-form
sidebar-ul top-tags tag-cloud
- main-sidebar post-sidebar related-tag-cloud
+ main-sidebar post-sidebar tag-sidebar related-tag-cloud
post-link admin-post-url admin-post-link
show-post with-authentication
find-posts-matching
@@ -348,6 +348,17 @@
,(post-link (car post-and-tags))))
(take-max (compute-related-posts post index) 10)))))))
+(define (tag-sidebar tag index)
+ (sidebar-ul
+ `((li (h2 (a (@ (href ,(relurl '("feed" "atom")
+ #:query `(("with" . ,tag)))))
+ "subscribe "
+ (img (@ (src ,(relurl '("wp-content" "feed-icon-14x14.png")))
+ (alt "[feed]"))))))
+ (li (h2 "related tags " ,(rellink '("tags") ">>"))
+ (ul (li (@ (style "line-height: 150%"))
+ ,@(tag-cloud (compute-related-tags tag index))))))))
+
(define (related-tag-cloud tag index)
`(div (@ (id "tag-cloud"))
(h2 "related tags")
diff --git a/tekuti/page.scm b/tekuti/page.scm
index 58ad45e..1794645 100644
--- a/tekuti/page.scm
+++ b/tekuti/page.scm
@@ -283,13 +283,10 @@
(post-from-key index key))
(hash-ref tags tag '()))))
(if (pair? posts)
- (respond `((h2 "posts tagged \"" ,tag "\" ("
- ,(rellink '("feed" "atom") "feed"
- #:query `(("with" . ,tag)))
- ")")
- ,@(map (lambda (post) `(p ,(post-link post)))
- posts)
- ,(related-tag-cloud tag index))
+ (respond `(,(tag-sidebar tag index)
+ (h2 "posts tagged \"" ,tag "\"")
+ ,@(map (lambda (post) (show-post post #f))
+ (take-max posts 10)))
#:etag (assq-ref index 'master)
#:title (string-append "posts tagged \"" tag "\""))
(respond `((h2 "Unknown tag " ,tag)