.||. "downies/music/*"
.||. "images/*"
.||. "images/posts/*"
+ .||. "images/posts/*/*"
.||. "favicon.ico"
) $ do
route idRoute
>>= relativizeUrls
-- always show the most recent blog post
- match "index.html" $ do
+ create ["index.html"] $ do
route idRoute
compile $ do
- mostRecent <- (head . recentFirst) <$> loadAllSnapshots "posts/*.markdown" "non-relative"
+ mostRecent <- fmap head . recentFirst =<< loadAllSnapshots "posts/*.markdown" "non-relative"
makeItem (itemBody mostRecent) >>= relativizeUrls
match "templates/*" $ compile templateCompiler
--------------------------------------------------------------------------------
-postList :: ([Item String] -> [Item String]) -> Compiler String
+postList :: ([Item String] -> Compiler [Item String]) -> Compiler String
postList sortFilter = do
- posts <- sortFilter <$> loadAll ("posts/*.markdown" .&&. hasNoVersion)
+ posts <- sortFilter =<< loadAll ("posts/*.markdown" .&&. hasNoVersion)
itemTpl <- loadBody "templates/post-item.html"
list <- applyTemplateList itemTpl postCtx posts
return list