on master help sign in
Made hakyll function backward-compatible. Version bump.
commit715387756e57b539e29d036515e047cdf5d264ba authorJasper Van der Jeugt <jaspervdj@gmail.com> dateTue 19 Jan 2010, 20:42 (17 years ago) parent0ba0eac
8 files changed+20−15
examples/brochure/hakyll.hs+2−2 examples/hakyll/hakyll.hs+1−1 examples/morepages/hakyll.hs+2−2 examples/rssblog/hakyll.hs+2−2 examples/simpleblog/hakyll.hs+2−2 examples/tagblog/hakyll.hs+2−2 hakyll.cabal+1−1 src/Text/Hakyll.hs+8−3
examples/brochure/hakyll.hs+2−2
@@ -1,9 +1,9 @@
1−import Text.Hakyll (hakyll, defaultHakyllConfiguration)
1+import Text.Hakyll (hakyll)
22import Text.Hakyll.File (directory)
33import Text.Hakyll.Render (css, static, renderChain)
44import Text.Hakyll.Renderables (createPagePath)
55
6−main = hakyll defaultHakyllConfiguration $ do
6+main = hakyll $ do
77 directory css "css"
88 render "about.markdown"
99 render "index.markdown"
examples/hakyll/hakyll.hs+1−1
@@ -7,7 +7,7 @@ import Text.Hakyll.Regex
77import Control.Monad (mapM_, liftM)
88import Data.List (sort)
99
10−main = hakyll defaultHakyllConfiguration $ do
10+main = hakyll $ do
1111 directory css "css"
1212 directory static "images"
1313 directory static "examples"
examples/morepages/hakyll.hs+2−2
@@ -1,9 +1,9 @@
1−import Text.Hakyll (hakyll, defaultHakyllConfiguration)
1+import Text.Hakyll (hakyll)
22import Text.Hakyll.File (directory)
33import Text.Hakyll.Render (css, static, renderChain)
44import Text.Hakyll.Renderables (createPagePath, combine)
55
6−main = hakyll defaultHakyllConfiguration $ do
6+main = hakyll $ do
77 directory css "css"
88 render "about.markdown"
99 render "index.markdown"
examples/rssblog/hakyll.hs+2−2
@@ -1,7 +1,7 @@
11module Main where
22
33import Control.Monad.Reader (liftIO)
4−import Text.Hakyll (hakyll, defaultHakyllConfiguration)
4+import Text.Hakyll (hakyll)
55import Text.Hakyll.Render (renderAndConcat, renderChain, css)
66import Text.Hakyll.File (getRecursiveContents, directory)
77import Text.Hakyll.Renderables (createPagePath, createCustomPage)
@@ -9,7 +9,7 @@ import Data.List (sort)
99import Control.Monad (mapM_, liftM)
1010import Data.Either (Either(..))
1111
12−main = hakyll defaultHakyllConfiguration $ do
12+main = hakyll $ do
1313 -- Static directory.
1414 directory css "css"
1515
examples/simpleblog/hakyll.hs+2−2
@@ -1,6 +1,6 @@
11module Main where
22
3−import Text.Hakyll (hakyll, defaultHakyllConfiguration)
3+import Text.Hakyll (hakyll)
44import Text.Hakyll.Render
55import Text.Hakyll.Context
66import Text.Hakyll.File (getRecursiveContents, directory)
@@ -10,7 +10,7 @@ import Control.Monad (mapM_, liftM)
1010import Control.Monad.Reader (liftIO)
1111import Data.Either (Either(..))
1212
13−main = hakyll defaultHakyllConfiguration $ do
13+main = hakyll $ do
1414 -- Static directory.
1515 directory css "css"
1616
examples/tagblog/hakyll.hs+2−2
@@ -1,6 +1,6 @@
11module Main where
22
3−import Text.Hakyll (hakyll, defaultHakyllConfiguration)
3+import Text.Hakyll (hakyll)
44import Text.Hakyll.Render
55import Text.Hakyll.Tags (readTagMap, renderTagCloud, renderTagLinks)
66import Text.Hakyll.File (getRecursiveContents, directory, removeSpaces)
@@ -11,7 +11,7 @@ import Data.Map (toList)
1111import Control.Monad (mapM_, liftM)
1212import Data.Either (Either(..))
1313
14−main = hakyll defaultHakyllConfiguration $ do
14+main = hakyll $ do
1515 -- Static directory.
1616 directory css "css"
1717
hakyll.cabal+1−1
@@ -1,5 +1,5 @@
11Name: hakyll
2−Version: 1.0.1
2+Version: 1.1
33
44Synopsis: A simple static site generator library.
55Description:
src/Text/Hakyll.hs+8−3
@@ -1,6 +1,7 @@
11module Text.Hakyll
22 ( defaultHakyllConfiguration
33 , hakyll
4+ , hakyllWithConfiguration
45 ) where
56
67import Control.Monad.Reader (runReaderT)
@@ -18,9 +19,13 @@ defaultHakyllConfiguration = HakyllConfiguration
1819 { additionalContext = M.empty
1920 }
2021
21−-- | Main function to run hakyll.
22−hakyll :: HakyllConfiguration -> Hakyll () -> IO ()
23−hakyll configuration buildFunction = do
22+-- | Hakyll with a default configuration.
23+hakyll :: Hakyll () -> IO ()
24+hakyll = hakyllWithConfiguration defaultHakyllConfiguration
25+
26+-- | Main function to run hakyll with a configuration.
27+hakyllWithConfiguration :: HakyllConfiguration -> Hakyll () -> IO ()
28+hakyllWithConfiguration configuration buildFunction = do
2429 args <- getArgs
2530 case args of ["build"] -> build'
2631 ["clean"] -> clean