variable title for archive template
authorrekado <rekado@elephly.net>
Sun, 27 Oct 2013 01:39:40 +0000 (09:39 +0800)
committerrekado <rekado@elephly.net>
Sun, 27 Oct 2013 01:39:40 +0000 (09:39 +0800)
site.hs
templates/archive.html

diff --git a/site.hs b/site.hs
index 7f90e8c..3fd4a94 100644 (file)
--- a/site.hs
+++ b/site.hs
@@ -74,9 +74,12 @@ main = hakyllWith config $ do
 
     -- blog post archive
     create ["posts/index.html"] $ do
+      let title = "Archive"
+
       route   idRoute
       compile $ do
         let archiveCtx =
+              constField "title" title `mappend`
               field "posts" (\_ -> postList recentFirst) `mappend`
               defaultContext
 
index 67517d6..03bf609 100644 (file)
@@ -1,4 +1,4 @@
-<h1>Archive</h1>
+<h1>$title$</h1>
 <ul class="archive">
     $posts$
 </ul>