module Site.Contexts ( indexCtx , archiveCtx , logArchiveCtx , gsocArchiveCtx , postCtx , postForArchiveCtx , gsocPostForArchiveCtx , dateForArchiveCtx ) where import Data.Monoid ( (<>) ) import Site.Compilers import Hakyll ( Context , defaultContext , constField , dateField , listField ) indexCtx :: Context String indexCtx = listField "articles" defaultContext recentArticles <> listField "rposts" defaultContext recentPosts <> constField "essays" "Soon" <> constField "title" "Home" <> defaultContext archiveCtx :: String -> Context String archiveCtx title = constField "title" title <> defaultContext logArchiveCtx :: Context String logArchiveCtx = archiveCtx "archive of log posts" gsocArchiveCtx :: Context String gsocArchiveCtx = archiveCtx "archive of my GSoC reports." postCtx :: Context String postCtx = dateField "date" "%B %e, %Y" <> defaultContext postForArchiveCtx :: Context String 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