Add taglinks to individual posts.

This commit is contained in:
Brit Butler 2012-08-21 22:06:14 -04:00
parent cf10496557
commit 98ae73ddd3
3 changed files with 8 additions and 5 deletions

View file

@ -10,9 +10,9 @@
(reduce (lambda (x y) (union x y :test #'string=)) (reduce (lambda (x y) (union x y :test #'string=))
(mapcar #'post-tags (hash-table-values *posts*)))) (mapcar #'post-tags (hash-table-values *posts*))))
(defun taglinks () (defun taglinks (&optional tags)
"Generate links to all the tag indices." "Generate links to all the tag indices or those in TAGS."
(loop for tag in (sort (all-tags) #'string<) (loop for tag in (or tags (sort (all-tags) #'string<))
collect (list :url (format nil "~a/tag/~a.html" (domain *config*) tag) collect (list :url (format nil "~a/tag/~a.html" (domain *config*) tag)
:name tag))) :name tag)))

View file

@ -66,7 +66,7 @@
(render-page (post-url post) (render-page (post-url post)
(funcall (theme-fn "POST") (funcall (theme-fn "POST")
(list :title (post-title post) (list :title (post-title post)
:tags (post-tags post) :tags (taglinks (post-tags post))
:date (post-date post) :date (post-date post)
:content (render-content (post-content post) :content (render-content (post-content post)
(post-format post)) (post-format post))

View file

@ -4,7 +4,10 @@
<div class="article-meta">{\n} <div class="article-meta">{\n}
<h1 class="title">{$title}</h1>{\n} <h1 class="title">{$title}</h1>{\n}
<div class="tags">{\n} <div class="tags">{\n}
Tagged as {$tags} Tagged as {foreach $tag in $tags}
<a href="{$tag.url |noAutoescape}">{$tag.name}</a>
{if not isLast($tag)}, {/if}
{/foreach}
</div>{\n} </div>{\n}
<div class="date">{\n} <div class="date">{\n}
Written on {$date} Written on {$date}