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 7f90e8cc38e4cb0cf6c62cb7363cfa807e19f7f3..3fd4a94060f6c67dc72478af5d2d6d8514a08ecb 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 67517d68c7897510d19d3198694414939b984a15..03bf609b94af65eab4908e2345214273c66b028c 100644 (file)
@@ -1,4 +1,4 @@
-<h1>Archive</h1>
+<h1>$title$</h1>
 <ul class="archive">
     $posts$
 </ul>