summaryrefslogtreecommitdiff
path: root/site.hs
diff options
context:
space:
mode:
Diffstat (limited to 'site.hs')
-rw-r--r--site.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/site.hs b/site.hs
index 6cd7c52..793810a 100644
--- a/site.hs
+++ b/site.hs
@@ -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