summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Render.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-15 09:47:07 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-15 09:47:07 +0100
commit62330ceae51ea28f75768196ad5e3f93eb88b8a3 (patch)
treea3a45aa9e0d63c65eb4fc4e7a4277fde645b8f48 /src/Text/Hakyll/Render.hs
parenta180016488d0fed843f525db824dc0c24cde90ca (diff)
downloadhakyll-62330ceae51ea28f75768196ad5e3f93eb88b8a3.tar.gz
Moved some more functions from the IO monad to the Hakyll monad stack.
Diffstat (limited to 'src/Text/Hakyll/Render.hs')
-rw-r--r--src/Text/Hakyll/Render.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Text/Hakyll/Render.hs b/src/Text/Hakyll/Render.hs
index 4b22836..870c953 100644
--- a/src/Text/Hakyll/Render.hs
+++ b/src/Text/Hakyll/Render.hs
@@ -31,7 +31,7 @@ depends :: FilePath -- ^ File to be rendered or created.
-> Hakyll () -- ^ IO action to execute when the file is out of date.
-> Hakyll ()
depends file dependencies action = do
- valid <- liftIO $ isCacheValid (toDestination file) dependencies
+ valid <- isCacheValid (toDestination file) dependencies
unless valid action
-- | Render to a Page.
@@ -93,17 +93,17 @@ renderChainWith manipulation templatePaths renderable =
-- | Mark a certain file as static, so it will just be copied when the site is
-- generated.
static :: FilePath -> Hakyll ()
-static source = depends destination [source] (liftIO action)
+static source = depends destination [source] action
where
destination = toDestination source
action = do makeDirectories destination
- copyFile source destination
+ liftIO $ copyFile source destination
-- | Render a css file, compressing it.
css :: FilePath -> Hakyll ()
-css source = depends destination [source] (liftIO css')
+css source = depends destination [source] css'
where
destination = toDestination source
- css' = do contents <- readFile source
+ css' = do contents <- liftIO $ readFile source
makeDirectories destination
- writeFile destination (compressCSS contents)
+ liftIO $ writeFile destination (compressCSS contents)