diff options
| -rw-r--r-- | site.hs | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -35,6 +35,14 @@ main = hakyll $ do >>= loadAndApplyTemplate "templates/post.html" postCtx >>= relativizeUrls + create ["gsoc/index.html"] $ do + route idRoute + compile $ do + makeItem "" + >>= loadAndApplyTemplate "templates/archive.html" gsocPostForArchiveCtx + >>= loadAndApplyTemplate "templates/post.html" gsocArchiveCtx + >>= relativizeUrls + match "article/**" $ do route idRoute compile getResourceBody @@ -50,6 +58,9 @@ main = hakyll $ do -------------------------------------------------------------------------------- +gsocPosts :: Compiler [Item String] +gsocPosts = recentFirst =<< loadAll "gsoc/*.org" + posts :: Compiler [Item String] posts = recentFirst =<< loadAll "log/*.org" @@ -75,6 +86,11 @@ archiveCtx = constField "title" "archive of log posts" <> defaultContext +gsocArchiveCtx :: Context String +gsocArchiveCtx = + constField "title" "archive of my GSoC reports." + <> defaultContext + postCtx :: Context String postCtx = dateField "date" "%B %e, %Y" <> defaultContext @@ -84,6 +100,11 @@ postForArchiveCtx = listField "posts" dateForArchiveCtx posts <> defaultContext +gsocPostForArchiveCtx :: Context String +gsocPostForArchiveCtx = + listField "posts" dateForArchiveCtx gsocPosts + <> defaultContext + dateForArchiveCtx :: Context String dateForArchiveCtx = dateField "date" "%d %b %Y" <> defaultContext |
