summaryrefslogtreecommitdiff
path: root/src/Site/Compilers.hs
blob: dbb943bba5d1558c3adb39daca1789df9ec85ea5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
module Site.Compilers
        ( gsocPosts
        , posts
        , articles
        , recentPosts
        , recentArticles
        )
where

import           Hakyll                         ( Compiler
                                                , Item
                                                , loadAll
                                                , recentFirst
                                                , Pattern
                                                , fromGlob
                                                )

loadAllRecentFirst :: String -> Compiler [Item String]
loadAllRecentFirst glob = recentFirst =<< loadAll (fromGlob glob)

gsocPosts :: Compiler [Item String]
gsocPosts = loadAllRecentFirst "gsoc/*.org"

posts :: Compiler [Item String]
posts = loadAllRecentFirst "log/*.org"

articles :: Compiler [Item String]
articles = loadAll (fromGlob "article/**")

recentPosts :: Compiler [Item String]
recentPosts = take 4 <$> posts

recentArticles :: Compiler [Item String]
recentArticles = take 4 <$> articles