diff options
| author | Carlos Sosa <gnusosa@gnusosa.net> | 2019-08-15 23:13:43 -0700 |
|---|---|---|
| committer | Carlos Sosa <gnusosa@gnusosa.net> | 2019-08-15 23:13:43 -0700 |
| commit | 3fd226a458f77451fd97daf2b67f94747d07cb5a (patch) | |
| tree | 0f5be395b7044e2cb39317e4e248c7efd5dcbc02 /site.hs | |
| parent | a2dc4200acf469a05f9f028439ffdb2c6180d3d9 (diff) | |
Add GSoC posts archive matchers and functions
Diffstat (limited to 'site.hs')
| -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 |
