render tags on archive page
authorrekado <rekado@elephly.net>
Thu, 31 Oct 2013 14:45:04 +0000 (22:45 +0800)
committerrekado <rekado@elephly.net>
Thu, 31 Oct 2013 14:45:15 +0000 (22:45 +0800)
site.hs
templates/archive.html

diff --git a/site.hs b/site.hs
index 4aec4c65b5c107343341447d1cdbcbb0b21619fc..96bfdfdaf686dd2a91173c6f6c25c0cee445767a 100644 (file)
--- a/site.hs
+++ b/site.hs
@@ -83,6 +83,7 @@ main = hakyllWith config $ do
         let archiveCtx =
               constField "title" title <>
               field "posts" (\_ -> postList "posts/*.markdown" recentFirst) <>
+              field "tags" (\_ -> renderTagList tags) <>
               defaultContext
 
         makeItem ""
@@ -108,6 +109,7 @@ main = hakyllWith config $ do
       compile $ do
         let ctx = constField "title" title <>
                   field "posts" (\_ -> postList pattern recentFirst) <>
+                  tagsField "tags" tags <>
                   defaultContext
 
         makeItem ""
index 03bf609b94af65eab4908e2345214273c66b028c..cbd0827008ea2997e86fab2f210cea3c789cb86e 100644 (file)
@@ -1,4 +1,5 @@
 <h1>$title$</h1>
+<div class="tags">$tags$</div>
 <ul class="archive">
     $posts$
 </ul>