diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-01-19 20:42:16 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-01-19 20:42:16 +0100 |
commit | 715387756e57b539e29d036515e047cdf5d264ba (patch) | |
tree | 2221ca421c0a5abf4a2c5f8cda14c5582f243b3b | |
parent | 0ba0eac8d96c11d13163c7ec184392513de7ca77 (diff) | |
download | hakyll-715387756e57b539e29d036515e047cdf5d264ba.tar.gz |
Made hakyll function backward-compatible. Version bump.
-rw-r--r-- | examples/brochure/hakyll.hs | 4 | ||||
-rw-r--r-- | examples/hakyll/hakyll.hs | 2 | ||||
-rw-r--r-- | examples/morepages/hakyll.hs | 4 | ||||
-rw-r--r-- | examples/rssblog/hakyll.hs | 4 | ||||
-rw-r--r-- | examples/simpleblog/hakyll.hs | 4 | ||||
-rw-r--r-- | examples/tagblog/hakyll.hs | 4 | ||||
-rw-r--r-- | hakyll.cabal | 2 | ||||
-rw-r--r-- | src/Text/Hakyll.hs | 11 |
8 files changed, 20 insertions, 15 deletions
diff --git a/examples/brochure/hakyll.hs b/examples/brochure/hakyll.hs index e87499f..b2606ba 100644 --- a/examples/brochure/hakyll.hs +++ b/examples/brochure/hakyll.hs @@ -1,9 +1,9 @@ -import Text.Hakyll (hakyll, defaultHakyllConfiguration) +import Text.Hakyll (hakyll) import Text.Hakyll.File (directory) import Text.Hakyll.Render (css, static, renderChain) import Text.Hakyll.Renderables (createPagePath) -main = hakyll defaultHakyllConfiguration $ do +main = hakyll $ do directory css "css" render "about.markdown" render "index.markdown" diff --git a/examples/hakyll/hakyll.hs b/examples/hakyll/hakyll.hs index 4e3b3b6..76d95d6 100644 --- a/examples/hakyll/hakyll.hs +++ b/examples/hakyll/hakyll.hs @@ -7,7 +7,7 @@ import Text.Hakyll.Regex import Control.Monad (mapM_, liftM) import Data.List (sort) -main = hakyll defaultHakyllConfiguration $ do +main = hakyll $ do directory css "css" directory static "images" directory static "examples" diff --git a/examples/morepages/hakyll.hs b/examples/morepages/hakyll.hs index a806042..5896fdc 100644 --- a/examples/morepages/hakyll.hs +++ b/examples/morepages/hakyll.hs @@ -1,9 +1,9 @@ -import Text.Hakyll (hakyll, defaultHakyllConfiguration) +import Text.Hakyll (hakyll) import Text.Hakyll.File (directory) import Text.Hakyll.Render (css, static, renderChain) import Text.Hakyll.Renderables (createPagePath, combine) -main = hakyll defaultHakyllConfiguration $ do +main = hakyll $ do directory css "css" render "about.markdown" render "index.markdown" diff --git a/examples/rssblog/hakyll.hs b/examples/rssblog/hakyll.hs index 581da9e..8d403b4 100644 --- a/examples/rssblog/hakyll.hs +++ b/examples/rssblog/hakyll.hs @@ -1,7 +1,7 @@ module Main where import Control.Monad.Reader (liftIO) -import Text.Hakyll (hakyll, defaultHakyllConfiguration) +import Text.Hakyll (hakyll) import Text.Hakyll.Render (renderAndConcat, renderChain, css) import Text.Hakyll.File (getRecursiveContents, directory) import Text.Hakyll.Renderables (createPagePath, createCustomPage) @@ -9,7 +9,7 @@ import Data.List (sort) import Control.Monad (mapM_, liftM) import Data.Either (Either(..)) -main = hakyll defaultHakyllConfiguration $ do +main = hakyll $ do -- Static directory. directory css "css" diff --git a/examples/simpleblog/hakyll.hs b/examples/simpleblog/hakyll.hs index 1b26bce..bdcb3fe 100644 --- a/examples/simpleblog/hakyll.hs +++ b/examples/simpleblog/hakyll.hs @@ -1,6 +1,6 @@ module Main where -import Text.Hakyll (hakyll, defaultHakyllConfiguration) +import Text.Hakyll (hakyll) import Text.Hakyll.Render import Text.Hakyll.Context import Text.Hakyll.File (getRecursiveContents, directory) @@ -10,7 +10,7 @@ import Control.Monad (mapM_, liftM) import Control.Monad.Reader (liftIO) import Data.Either (Either(..)) -main = hakyll defaultHakyllConfiguration $ do +main = hakyll $ do -- Static directory. directory css "css" diff --git a/examples/tagblog/hakyll.hs b/examples/tagblog/hakyll.hs index b9a01eb..df5e9d0 100644 --- a/examples/tagblog/hakyll.hs +++ b/examples/tagblog/hakyll.hs @@ -1,6 +1,6 @@ module Main where -import Text.Hakyll (hakyll, defaultHakyllConfiguration) +import Text.Hakyll (hakyll) import Text.Hakyll.Render import Text.Hakyll.Tags (readTagMap, renderTagCloud, renderTagLinks) import Text.Hakyll.File (getRecursiveContents, directory, removeSpaces) @@ -11,7 +11,7 @@ import Data.Map (toList) import Control.Monad (mapM_, liftM) import Data.Either (Either(..)) -main = hakyll defaultHakyllConfiguration $ do +main = hakyll $ do -- Static directory. directory css "css" diff --git a/hakyll.cabal b/hakyll.cabal index bdba45d..9ce3e5f 100644 --- a/hakyll.cabal +++ b/hakyll.cabal @@ -1,5 +1,5 @@ Name: hakyll -Version: 1.0.1 +Version: 1.1 Synopsis: A simple static site generator library. Description: diff --git a/src/Text/Hakyll.hs b/src/Text/Hakyll.hs index 5c2fbd5..c0486e7 100644 --- a/src/Text/Hakyll.hs +++ b/src/Text/Hakyll.hs @@ -1,6 +1,7 @@ module Text.Hakyll ( defaultHakyllConfiguration , hakyll + , hakyllWithConfiguration ) where import Control.Monad.Reader (runReaderT) @@ -18,9 +19,13 @@ defaultHakyllConfiguration = HakyllConfiguration { additionalContext = M.empty } --- | Main function to run hakyll. -hakyll :: HakyllConfiguration -> Hakyll () -> IO () -hakyll configuration buildFunction = do +-- | Hakyll with a default configuration. +hakyll :: Hakyll () -> IO () +hakyll = hakyllWithConfiguration defaultHakyllConfiguration + +-- | Main function to run hakyll with a configuration. +hakyllWithConfiguration :: HakyllConfiguration -> Hakyll () -> IO () +hakyllWithConfiguration configuration buildFunction = do args <- getArgs case args of ["build"] -> build' ["clean"] -> clean |