summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-03-04 23:52:52 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-03-04 23:52:52 +0100
commit5d577bb8ef62d41c08a3e17af3ca411d581ac88c (patch)
tree288634465d6a4de8e00652fa513ef52875bb6085 /src
parent66ad9ce7f28750034b830def8741c72cf1b54215 (diff)
downloadhakyll-5d577bb8ef62d41c08a3e17af3ca411d581ac88c.tar.gz
static and css now both use arrows.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Hakyll/Render.hs32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/Text/Hakyll/Render.hs b/src/Text/Hakyll/Render.hs
index 71d95ae..ef7493c 100644
--- a/src/Text/Hakyll/Render.hs
+++ b/src/Text/Hakyll/Render.hs
@@ -125,17 +125,31 @@ renderChainWith manipulation templatePaths initial =
-- | Mark a certain file as static, so it will just be copied when the site is
-- generated.
static :: FilePath -> Hakyll ()
-static source = do destination <- toDestination source
- depends destination [source] (action destination)
+static source = runRenderAction static'
where
- action destination = do makeDirectories destination
- liftIO $ copyFile source destination
+ static' = RenderAction
+ { actionDependencies = [source]
+ , actionUrl = Just $ return source
+ , actionFunction = actionFunction'
+ }
+
+ actionFunction' _ = do
+ destination <- toDestination source
+ makeDirectories destination
+ liftIO $ copyFile source destination
-- | Render a css file, compressing it.
css :: FilePath -> Hakyll ()
-css source = do destination <- toDestination source
- depends destination [source] (css' destination)
+css source = runRenderAction css'
where
- css' destination = do contents <- liftIO $ readFile source
- makeDirectories destination
- liftIO $ writeFile destination (compressCss contents)
+ css' = RenderAction
+ { actionDependencies = [source]
+ , actionUrl = Just $ return source
+ , actionFunction = actionFunction'
+ }
+
+ actionFunction' _ = do
+ contents <- liftIO $ readFile source
+ destination <- toDestination source
+ makeDirectories destination
+ liftIO $ writeFile destination (compressCss contents)