diff options
| author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-04-05 22:02:40 +0200 |
|---|---|---|
| committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-04-05 22:02:40 +0200 |
| commit | 433f36e6f3efdf95276fe0a5f486db3be2824445 (patch) | |
| tree | 4eba909cfe316224f49e5bc87d340cc98d1f670c /examples/simpleblog/hakyll.hs | |
| parent | 041ec5c3096684d045637ddd72741192b9050e36 (diff) | |
| parent | 19dc9f5f9fb8bda417e5b5dcc47b9cf83c541366 (diff) | |
| download | hakyll-433f36e6f3efdf95276fe0a5f486db3be2824445.tar.gz | |
Merge branch 'nested-rules'
Diffstat (limited to 'examples/simpleblog/hakyll.hs')
| -rw-r--r-- | examples/simpleblog/hakyll.hs | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/examples/simpleblog/hakyll.hs b/examples/simpleblog/hakyll.hs index db4230f..270c3e3 100644 --- a/examples/simpleblog/hakyll.hs +++ b/examples/simpleblog/hakyll.hs @@ -11,42 +11,38 @@ import Hakyll main :: IO () main = hakyll $ do -- Compress CSS - route "css/*" idRoute - compile "css/*" compressCssCompiler + match "css/*" $ do + route idRoute + compile compressCssCompiler -- Render posts - route "posts/*" $ setExtension ".html" - compile "posts/*" $ - pageCompiler + match "posts/*" $ do + route $ setExtension ".html" + compile $ pageCompiler >>> applyTemplateCompiler "templates/post.html" >>> applyTemplateCompiler "templates/default.html" >>> relativizeUrlsCompiler -- Render posts list - route "posts.html" $ idRoute - create "posts.html" $ - constA mempty - >>> arr (setField "title" "All posts") - >>> requireAllA "posts/*" addPostList - >>> applyTemplateCompiler "templates/posts.html" - >>> applyTemplateCompiler "templates/default.html" - >>> relativizeUrlsCompiler + match "posts.html" $ route idRoute + create "posts.html" $ constA mempty + >>> arr (setField "title" "All posts") + >>> requireAllA "posts/*" addPostList + >>> applyTemplateCompiler "templates/posts.html" + >>> applyTemplateCompiler "templates/default.html" + >>> relativizeUrlsCompiler -- Index - route "index.html" idRoute - create "index.html" $ - constA mempty - >>> arr (setField "title" "Home") - >>> requireAllA "posts/*" (id *** arr (take 3 . reverse . sortByBaseName) >>> addPostList) - >>> applyTemplateCompiler "templates/index.html" - >>> applyTemplateCompiler "templates/default.html" - >>> relativizeUrlsCompiler + match "index.html" $ route idRoute + create "index.html" $ constA mempty + >>> arr (setField "title" "Home") + >>> requireAllA "posts/*" (id *** arr (take 3 . reverse . sortByBaseName) >>> addPostList) + >>> applyTemplateCompiler "templates/index.html" + >>> applyTemplateCompiler "templates/default.html" + >>> relativizeUrlsCompiler -- Read templates - compile "templates/*" templateCompiler - - -- End - return () + match "templates/*" $ compile templateCompiler -- | Auxiliary compiler: generate a post list from a list of given posts, and -- add it to the current page under @$posts@ |
