Skip to content

Commit 5d32eb7

Browse files
Merge pull request #258 from haskellfoundation/doubled-content
Remove duplicated content from the entire site
2 parents 19fcdbd + 5dda189 commit 5d32eb7

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

site.hs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ main = hakyll $ do
4141
route idRoute
4242
compile $ do
4343
sponsors <- buildBoilerplateCtx (Just "Sponsorship")
44-
iks <- loadAll "donations/inkind/*.markdown"
44+
iks <- loadAll ("donations/inkind/*.markdown" .&&. hasNoVersion)
4545

4646
let ctx =
4747
listField "inkinds" defaultContext (return iks) <>
@@ -69,7 +69,7 @@ main = hakyll $ do
6969
route idRoute
7070
compile $ do
7171
sponsors <- buildBoilerplateCtx (Just "Affiliates")
72-
ctx <- affiliatesCtx . sortOn itemIdentifier <$> loadAll "affiliates/*.markdown"
72+
ctx <- affiliatesCtx . sortOn itemIdentifier <$> loadAll ("affiliates/*.markdown" .&&. hasNoVersion)
7373

7474
makeItem ""
7575
>>= loadAndApplyTemplate "templates/affiliates/list.html" ctx
@@ -125,7 +125,7 @@ main = hakyll $ do
125125
route idRoute
126126
compile $ do
127127
sponsors <- buildBoilerplateCtx (Just "Press")
128-
press <- recentFirst =<< loadAll "press/*.markdown"
128+
press <- recentFirst =<< loadAll ("press/*.markdown" .&&. hasNoVersion)
129129

130130
let ctx =
131131
listField "press_articles" defaultContext (return press) <>
@@ -142,7 +142,7 @@ main = hakyll $ do
142142
route idRoute
143143
compile $ do
144144
sponsors <- buildBoilerplateCtx (Just "FAQ")
145-
ctx <- faqCtx <$> loadAll "faq/*.markdown"
145+
ctx <- faqCtx <$> loadAll ("faq/*.markdown" .&&. hasNoVersion)
146146

147147
makeItem ""
148148
>>= loadAndApplyTemplate "templates/faq/list.html" ctx
@@ -155,7 +155,7 @@ main = hakyll $ do
155155
route idRoute
156156
compile $ do
157157
sponsors <- buildBoilerplateCtx (Just "Who We Are")
158-
ctx <- whoWeAreCtx <$> loadAll "who-we-are/people/*.markdown"
158+
ctx <- whoWeAreCtx <$> loadAll ("who-we-are/people/*.markdown" .&&. hasNoVersion)
159159

160160
makeItem ""
161161
>>= loadAndApplyTemplate "templates/who-we-are/exec-and-board.html" ctx
@@ -166,7 +166,7 @@ main = hakyll $ do
166166
route idRoute
167167
compile $ do
168168
sponsors <- buildBoilerplateCtx (Just "Past Boards")
169-
ctx <- whoWeAreCtx <$> loadAll "who-we-are/people/*.markdown"
169+
ctx <- whoWeAreCtx <$> loadAll ("who-we-are/people/*.markdown" .&&. hasNoVersion)
170170

171171
makeItem ""
172172
>>= loadAndApplyTemplate "templates/who-we-are/past-board.html" ctx
@@ -247,7 +247,7 @@ main = hakyll $ do
247247
compile $ do
248248
sponsors <- buildBoilerplateCtx (Just "Haskell Foundation")
249249
podcastsCtx <- podcastListCtx . take 1 . reverse . sortOn podcastOrd <$> loadAll ("podcast/*/index.markdown" .&&. hasVersion "raw")
250-
careers <- loadAll @String "careers/*.markdown"
250+
careers <- loadAll @String ("careers/*.markdown" .&&. hasNoVersion)
251251
careersCtx <- careersCtx . reverse <$> loadAll "careers/*.markdown"
252252
announces <- take 1 <$> (recentFirst =<< loadAll @String ("news/*/**.markdown" .&&. hasNoVersion))
253253
let announceCtx = announcementsCtx announces
@@ -274,7 +274,7 @@ main = hakyll $ do
274274
route idRoute
275275
compile $ do
276276
sponsors <- buildBoilerplateCtx (Just "Resources")
277-
resources <- loadAll "resources/*.markdown"
277+
resources <- loadAll ("resources/*.markdown" .&&. hasNoVersion)
278278

279279
let ctx =
280280
listField "resources" defaultContext (return resources) <>
@@ -300,8 +300,8 @@ main = hakyll $ do
300300
route idRoute
301301
compile $ do
302302
sponsors <- buildBoilerplateCtx (Just "Careers")
303-
ctx <- careersCtx <$> loadAll "careers/*.markdown"
304-
hiringSponsors <- hiringSponsorsCtx <$> loadAll "donations/sponsors/*.markdown"
303+
ctx <- careersCtx <$> loadAll ("careers/*.markdown" .&&. hasNoVersion)
304+
hiringSponsors <- hiringSponsorsCtx <$> loadAll ("donations/sponsors/*.markdown" .&&. hasNoVersion)
305305

306306
makeItem ""
307307
>>= loadAndApplyTemplate "templates/careers/list.html" (ctx <> hiringSponsors)
@@ -329,7 +329,8 @@ main = hakyll $ do
329329
-- sponsors --------------------------------------------------------------------------------------------
330330

331331
buildBoilerplateCtx :: Maybe String -> Compiler (Context String)
332-
buildBoilerplateCtx mtitle = boilerPlateCtx mtitle . sortOn itemIdentifier <$> loadAll "donations/sponsors/*.markdown"
332+
buildBoilerplateCtx mtitle =
333+
boilerPlateCtx mtitle . sortOn itemIdentifier <$> loadAll ("donations/sponsors/*.markdown" .&&. hasNoVersion)
333334

334335
-- | Partition sponsors into by level: monad, applicative, and functor
335336
-- Sponsors are listed in the footer template, which means we need this

0 commit comments

Comments
 (0)