diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-03-04 23:52:52 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-03-04 23:52:52 +0100 |
commit | 5d577bb8ef62d41c08a3e17af3ca411d581ac88c (patch) | |
tree | 288634465d6a4de8e00652fa513ef52875bb6085 /src/Text/Hakyll | |
parent | 66ad9ce7f28750034b830def8741c72cf1b54215 (diff) | |
download | hakyll-5d577bb8ef62d41c08a3e17af3ca411d581ac88c.tar.gz |
static and css now both use arrows.
Diffstat (limited to 'src/Text/Hakyll')
-rw-r--r-- | src/Text/Hakyll/Render.hs | 32 |
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) |