1
0
Fork 0

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.
This commit is contained in:
Tom Willemsen 2013-04-03 03:16:02 +02:00
parent a08ae0c9a7
commit ea8c3a5642
2 changed files with 16 additions and 8 deletions

View file

@ -43,7 +43,7 @@
post-url post-url
post-editing-form post-editing-form
sidebar-ul top-tags tag-cloud 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 post-link admin-post-url admin-post-link
show-post with-authentication show-post with-authentication
find-posts-matching find-posts-matching
@ -348,6 +348,17 @@
,(post-link (car post-and-tags)))) ,(post-link (car post-and-tags))))
(take-max (compute-related-posts post index) 10))))))) (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) (define (related-tag-cloud tag index)
`(div (@ (id "tag-cloud")) `(div (@ (id "tag-cloud"))
(h2 "related tags") (h2 "related tags")

View file

@ -283,13 +283,10 @@
(post-from-key index key)) (post-from-key index key))
(hash-ref tags tag '())))) (hash-ref tags tag '()))))
(if (pair? posts) (if (pair? posts)
(respond `((h2 "posts tagged \"" ,tag "\" (" (respond `(,(tag-sidebar tag index)
,(rellink '("feed" "atom") "feed" (h2 "posts tagged \"" ,tag "\"")
#:query `(("with" . ,tag))) ,@(map (lambda (post) (show-post post #f))
")") (take-max posts 10)))
,@(map (lambda (post) `(p ,(post-link post)))
posts)
,(related-tag-cloud tag index))
#:etag (assq-ref index 'master) #:etag (assq-ref index 'master)
#:title (string-append "posts tagged \"" tag "\"")) #:title (string-append "posts tagged \"" tag "\""))
(respond `((h2 "Unknown tag " ,tag) (respond `((h2 "Unknown tag " ,tag)