@@ -12,13 +12,14 @@ import Hakyll
1212main :: IO ()
1313main = hakyll $ do
1414 -- Compress CSS
15− route "css/*" idRoute
16− compile "css/*" compressCssCompiler
15+ match "css/*" $ do
16+ route idRoute
17+ compile compressCssCompiler
1718
1819 -- Render posts
19− route "posts/*" $ setExtension ".html"
20− compile "posts/*" $
21− pageCompiler
20+ match "posts/*" $ do
21+ route $ setExtension ".html"
22+ compile $ pageCompiler
2223 >>> arr (renderDateField "date" "%B %e, %Y" "Date unknown")
2324 >>> renderTagsField "prettytags" (fromCaptureString "tags/*")
2425 >>> applyTemplateCompiler "templates/post.html"
@@ -26,48 +27,43 @@ main = hakyll $ do
2627 >>> relativizeUrlsCompiler
2728
2829 -- Render posts list
29− route "posts.html" $ idRoute
30− create "posts.html" $
31− constA mempty
32− >>> arr (setField "title" "All posts")
33− >>> requireAllA "posts/*" addPostList
34− >>> applyTemplateCompiler "templates/posts.html"
35− >>> applyTemplateCompiler "templates/default.html"
36− >>> relativizeUrlsCompiler
30+ match "posts.html" $ route idRoute
31+ create "posts.html" $ constA mempty
32+ >>> arr (setField "title" "All posts")
33+ >>> requireAllA "posts/*" addPostList
34+ >>> applyTemplateCompiler "templates/posts.html"
35+ >>> applyTemplateCompiler "templates/default.html"
36+ >>> relativizeUrlsCompiler
3737
3838 -- Index
39− route "index.html" $ idRoute
40− create "index.html" $
41− constA mempty
42− >>> arr (setField "title" "Home")
43− >>> requireA "tags" (setFieldA "tagcloud" (renderTagCloud'))
44− >>> requireAllA "posts/*" (id *** arr (take 3 . reverse . sortByBaseName) >>> addPostList)
45− >>> applyTemplateCompiler "templates/index.html"
46− >>> applyTemplateCompiler "templates/default.html"
47− >>> relativizeUrlsCompiler
39+ match "index.html" $ route idRoute
40+ create "index.html" $ constA mempty
41+ >>> arr (setField "title" "Home")
42+ >>> requireA "tags" (setFieldA "tagcloud" (renderTagCloud'))
43+ >>> requireAllA "posts/*" (id *** arr (take 3 . reverse . sortByBaseName) >>> addPostList)
44+ >>> applyTemplateCompiler "templates/index.html"
45+ >>> applyTemplateCompiler "templates/default.html"
46+ >>> relativizeUrlsCompiler
4847
4948 -- Tags
5049 create "tags" $
5150 requireAll "posts/*" (\_ ps -> readTags ps :: Tags String)
5251
5352 -- Add a tag list compiler for every tag
54− route "tags/*" $ setExtension ".html"
53+ match "tags/*" $ route $ setExtension ".html"
5554 metaCompile $ require_ "tags"
5655 >>> arr (M.toList . tagsMap)
5756 >>> arr (map (\(t, p) -> (tagIdentifier t, makeTagList t p)))
5857
5958 -- Render RSS feed
60− route "rss.xml" $ idRoute
59+ match "rss.xml" $ route idRoute
6160 create "rss.xml" $
6261 requireAll_ "posts/*"
6362 >>> mapCompiler (arr $ copyBodyToField "description")
6463 >>> renderRss feedConfiguration
6564
6665 -- Read templates
67− compile "templates/*" templateCompiler
68−
69− -- End
70− return ()
66+ match "templates/*" $ compile templateCompiler
7167 where
7268 renderTagCloud' :: Compiler (Tags String) String
7369 renderTagCloud' = renderTagCloud tagIdentifier 100 120