From 5d577bb8ef62d41c08a3e17af3ca411d581ac88c Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Thu, 4 Mar 2010 23:52:52 +0100 Subject: static and css now both use arrows. --- src/Text/Hakyll/Render.hs | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'src/Text') 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) -- cgit v1.2.3