Skip to content

Commit f9069df

Browse files
authored
Merge pull request #194 from nomeata/hakyll
fix podcast order
2 parents 31812a5 + 571ea69 commit f9069df

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

site.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ main = hakyll $ do
175175
route idRoute
176176
compile $ do
177177
sponsors <- buildBoilerplateCtx (Just "Haskell Interlude")
178-
ctx <- podcastCtx <$> loadAll ("podcast/*/index.markdown" .&&. hasVersion "raw")
178+
ctx <- podcastCtx . sortOn podcastOrd <$> loadAll ("podcast/*/index.markdown" .&&. hasVersion "raw")
179179

180180
makeItem ""
181181
>>= loadAndApplyTemplate "templates/podcast/list.html" ctx
@@ -212,7 +212,7 @@ main = hakyll $ do
212212
route idRoute
213213
compile $ do
214214
sponsors <- buildBoilerplateCtx (Just "Haskell Foundation")
215-
podcastsCtx <- podcastCtx . take 1 . reverse <$> loadAll ("podcast/*/index.markdown" .&&. hasVersion "raw")
215+
podcastsCtx <- podcastCtx . take 1 . reverse . sortOn podcastOrd <$> loadAll ("podcast/*/index.markdown" .&&. hasVersion "raw")
216216
careersCtx <- careersCtx . reverse <$> loadAll "careers/*.markdown"
217217

218218
makeItem ""
@@ -386,6 +386,9 @@ podcastCtx episodes =
386386
listField "episodes" defaultContext (return $ reverse episodes) <>
387387
defaultContext
388388

389+
podcastOrd :: Item String -> Integer
390+
podcastOrd = read . head . fromJust . capture "podcast/*/index.markdown" . itemIdentifier
391+
389392
-- careers ---------------------------------------------------------------------------------------------
390393
careersCtx :: [Item String] -> Context String
391394
careersCtx reqs =

0 commit comments

Comments
 (0)