@@ -25,7 +25,7 @@ main = hakyll $ do
25
25
match " index.html" $ do
26
26
route idRoute
27
27
compile $ do
28
- sponsors <- sponsorsCtx . sortOn itemIdentifier <$> loadAll " donations/sponsors/*.markdown "
28
+ sponsors <- buildSponsorsCtx
29
29
getResourceBody
30
30
>>= applyAsTemplate sponsors
31
31
>>= loadAndApplyTemplate " templates/boilerplate.html" sponsors
@@ -39,7 +39,7 @@ main = hakyll $ do
39
39
create [" affiliates/index.html" ] $ do
40
40
route idRoute
41
41
compile $ do
42
- sponsors <- sponsorsCtx . sortOn itemIdentifier <$> loadAll " donations/sponsors/*.markdown "
42
+ sponsors <- buildSponsorsCtx
43
43
ctx <- affiliatesCtx . sortOn itemIdentifier <$> loadAll " affiliates/*.markdown"
44
44
45
45
makeItem " "
@@ -52,7 +52,7 @@ main = hakyll $ do
52
52
create [" projects/index.html" ] $ do
53
53
route idRoute
54
54
compile $ do
55
- sponsors <- sponsorsCtx . sortOn itemIdentifier <$> loadAll " donations/sponsors/*.markdown "
55
+ sponsors <- buildSponsorsCtx
56
56
ctx <- projectsCtx . sortOn itemIdentifier <$> loadAll " projects/*.markdown"
57
57
58
58
makeItem " "
@@ -78,7 +78,7 @@ main = hakyll $ do
78
78
create [" news/index.html" ] $ do
79
79
route idRoute
80
80
compile $ do
81
- sponsors <- sponsorsCtx . sortOn itemIdentifier <$> loadAll " donations/sponsors/*.markdown "
81
+ sponsors <- buildSponsorsCtx
82
82
newsWithCategories <- recentFirst =<< loadAll " news/categories/**.html"
83
83
84
84
let ctx =
@@ -95,15 +95,15 @@ main = hakyll $ do
95
95
create [" news/press/index.html" ] $ do
96
96
route idRoute
97
97
compile $ do
98
- sponsors <- sponsorsCtx . sortOn itemIdentifier <$> loadAll " donations/sponsors/*.markdown "
98
+ sponsors <- buildSponsorsCtx
99
99
press <- recentFirst =<< loadAll " press/*.markdown"
100
100
101
101
let ctx =
102
102
listField " press_articles" defaultContext (return press) <>
103
103
defaultContext
104
104
105
105
makeItem " "
106
- >>= loadAndApplyTemplate " templates/press/list.html" ctx
106
+ >>= loadAndApplyTemplate " templates/press/list.html" ctx
107
107
>>= loadAndApplyTemplate " templates/boilerplate.html" sponsors
108
108
>>= relativizeUrls
109
109
@@ -112,14 +112,31 @@ main = hakyll $ do
112
112
create [" faq/index.html" ] $ do
113
113
route idRoute
114
114
compile $ do
115
- sponsors <- sponsorsCtx . sortOn itemIdentifier <$> loadAll " donations/sponsors/*.markdown "
115
+ sponsors <- buildSponsorsCtx
116
116
ctx <- faqCtx <$> loadAll " faq/*.markdown"
117
117
118
118
makeItem " "
119
119
>>= loadAndApplyTemplate " templates/faq/list.html" ctx
120
120
>>= loadAndApplyTemplate " templates/boilerplate.html" sponsors
121
121
>>= relativizeUrls
122
122
123
+ -- resources -------------------------------------------------------------------------------------------
124
+ match " resources/*.markdown" $ compile pandocCompiler
125
+ create [" resources/index.html" ] $ do
126
+ route idRoute
127
+ compile $ do
128
+ sponsors <- buildSponsorsCtx
129
+ resources <- loadAll " resources/*.markdown"
130
+
131
+ let ctx =
132
+ listField " resources" defaultContext (return resources) <>
133
+ defaultContext
134
+
135
+ makeItem " "
136
+ >>= loadAndApplyTemplate " templates/resources/list.html" ctx
137
+ >>= loadAndApplyTemplate " templates/boilerplate.html" sponsors
138
+ >>= relativizeUrls
139
+
123
140
-- templates -------------------------------------------------------------------------------------------
124
141
match " templates/*" $ compile templateBodyCompiler
125
142
match " templates/**" $ compile templateBodyCompiler
@@ -130,6 +147,10 @@ main = hakyll $ do
130
147
--------------------------------------------------------------------------------------------------------
131
148
132
149
-- sponsors --------------------------------------------------------------------------------------------
150
+
151
+ buildSponsorsCtx :: Compiler (Context String )
152
+ buildSponsorsCtx = sponsorsCtx . sortOn itemIdentifier <$> loadAll " donations/sponsors/*.markdown"
153
+
133
154
-- | Partition sponsors into by level: monad, applicative, and functor
134
155
-- Sponsors are listed in the footer template, which means we need this
135
156
-- context for most pages.
0 commit comments