diff options
Diffstat (limited to 'site.hs')
| -rw-r--r-- | site.hs | 111 |
1 files changed, 0 insertions, 111 deletions
diff --git a/site.hs b/site.hs deleted file mode 100644 index 6f3ffa0..0000000 --- a/site.hs +++ /dev/null @@ -1,111 +0,0 @@ --------------------------------------------------------------------------------- -{-# LANGUAGE OverloadedStrings #-} -import Data.Monoid ((<>)) -import Hakyll - - --------------------------------------------------------------------------------- -main :: IO () -main = hakyll $ do - match "img/*" $ do - route idRoute - compile copyFileCompiler - - match "css/*" $ do - route idRoute - compile compressCssCompiler - - match "log/*.org" $ do - route $ setExtension "html" - compile $ pandocCompiler - >>= loadAndApplyTemplate "templates/post.html" postCtx - >>= relativizeUrls - - create ["log/index.html"] $ do - route idRoute - compile $ do - makeItem "" - >>= loadAndApplyTemplate "templates/post-list.html" postForArchiveCtx - >>= loadAndApplyTemplate "templates/post.html" archiveCtx - >>= relativizeUrls - - match "gsoc/*.org" $ do - route $ setExtension "html" - compile $ pandocCompiler - >>= loadAndApplyTemplate "templates/post.html" postCtx - >>= relativizeUrls - - create ["gsoc/index.html"] $ do - route idRoute - compile $ do - makeItem "" - >>= loadAndApplyTemplate "templates/post-list.html" gsocPostForArchiveCtx - >>= loadAndApplyTemplate "templates/post.html" gsocArchiveCtx - >>= relativizeUrls - - match "article/**" $ do - route idRoute - compile getResourceBody - - match "index.html" $ do - route idRoute - compile $ do - getResourceBody - >>= applyAsTemplate indexCtx - >>= relativizeUrls - - match "templates/*" $ compile templateBodyCompiler - - --------------------------------------------------------------------------------- -gsocPosts :: Compiler [Item String] -gsocPosts = recentFirst =<< loadAll "gsoc/*.org" - -posts :: Compiler [Item String] -posts = recentFirst =<< loadAll "log/*.org" - -articles :: Compiler [Item String] -articles = loadAll "article/**" - -recentPosts :: Compiler [Item String] -recentPosts = (take 4) <$> posts - -recentArticles :: Compiler [Item String] -recentArticles = (take 4) <$> articles - -indexCtx :: Context String -indexCtx = - listField "articles" defaultContext recentArticles - <> listField "rposts" defaultContext recentPosts - <> constField "essays" "Soon" - <> constField "title" "Home" - <> defaultContext - -archiveCtx :: Context String -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 - -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 - |
