diff options
Diffstat (limited to 'examples/brochure/hakyll.hs')
-rw-r--r-- | examples/brochure/hakyll.hs | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/examples/brochure/hakyll.hs b/examples/brochure/hakyll.hs index a74bee1..8040bdf 100644 --- a/examples/brochure/hakyll.hs +++ b/examples/brochure/hakyll.hs @@ -1,13 +1,18 @@ -import Text.Hakyll (hakyll) -import Text.Hakyll.File (directory) -import Text.Hakyll.Render (css, static, renderChain) -import Text.Hakyll.CreateContext (createPage) - -main = hakyll "http://example.com" $ do - directory css "css" - render "about.rst" - render "index.markdown" - render "code.lhs" - where - render = renderChain ["templates/default.html"] - . createPage +{-# LANGUAGE OverloadedStrings #-} +import Control.Arrow ((>>>)) +import Control.Monad (forM_) + +import Hakyll + +main :: IO () +main = hakyll $ do + route "css/*" idRoute + compile "css/*" compressCssCompiler + + compile "templates/*" templateCompiler + + forM_ ["about.rst", "index.markdown", "code.lhs"] $ \page -> do + route page $ setExtension "html" + compile page $ readPageCompiler + >>> applyTemplateCompiler "templates/default.html" + >>> relativizeUrlsCompiler |