summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Render.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-20 16:46:22 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-20 16:46:22 +0100
commit8602f23f7bcdcc3bec65ec98c70ee3f295482856 (patch)
tree8f86b9cb541ba0c4f1167a2211db090480d2f5b2 /src/Text/Hakyll/Render.hs
parentd79022fb3481dd2f6c2c0d9112c6c6f37c71204e (diff)
downloadhakyll-8602f23f7bcdcc3bec65ec98c70ee3f295482856.tar.gz
Made site and cache directory configurable. Caching stubs.
Diffstat (limited to 'src/Text/Hakyll/Render.hs')
-rw-r--r--src/Text/Hakyll/Render.hs21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/Text/Hakyll/Render.hs b/src/Text/Hakyll/Render.hs
index a0f067f..030d999 100644
--- a/src/Text/Hakyll/Render.hs
+++ b/src/Text/Hakyll/Render.hs
@@ -28,7 +28,8 @@ 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 <- isCacheValid (toDestination file) dependencies
+ destination <- toDestination file
+ valid <- isMoreRecent destination dependencies
unless valid action
-- | Render to a Page.
@@ -108,17 +109,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] action
+static source = do destination <- toDestination source
+ depends destination [source] (action destination)
where
- destination = toDestination source
- action = do makeDirectories destination
- liftIO $ copyFile source destination
+ action destination = do makeDirectories destination
+ liftIO $ copyFile source destination
-- | Render a css file, compressing it.
css :: FilePath -> Hakyll ()
-css source = depends destination [source] css'
+css source = do destination <- toDestination source
+ depends destination [source] (css' destination)
where
- destination = toDestination source
- css' = do contents <- liftIO $ readFile source
- makeDirectories destination
- liftIO $ writeFile destination (compressCSS contents)
+ css' destination = do contents <- liftIO $ readFile source
+ makeDirectories destination
+ liftIO $ writeFile destination (compressCSS contents)