diff options
| author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2009-12-13 10:15:21 +0100 |
|---|---|---|
| committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2009-12-13 10:15:21 +0100 |
| commit | a18789a6fbc1cff2a3828a626769cc96a8526026 (patch) | |
| tree | eb114ec09129960e2456d1b83facae49f0144517 /src/Text/Hakyll | |
| parent | 5d64ff7d5c9735ea17638e5b66dba0a44a0308db (diff) | |
| download | hakyll-a18789a6fbc1cff2a3828a626769cc96a8526026.tar.gz | |
Moved writePage to Text.Hakyll.Page.
Diffstat (limited to 'src/Text/Hakyll')
| -rw-r--r-- | src/Text/Hakyll/Page.hs | 10 | ||||
| -rw-r--r-- | src/Text/Hakyll/Render.hs | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/Text/Hakyll/Page.hs b/src/Text/Hakyll/Page.hs index 4bcacc4..1590de2 100644 --- a/src/Text/Hakyll/Page.hs +++ b/src/Text/Hakyll/Page.hs @@ -2,7 +2,8 @@ module Text.Hakyll.Page ( Page, fromContext, getBody, - readPage + readPage, + writePage ) where import qualified Data.Map as M @@ -116,6 +117,13 @@ readPage pagePath = do where url = toURL pagePath cacheFile = toCache url +-- | Write a page to the site destination. +writePage :: Page -> IO () +writePage page = do + let destination = toDestination $ getURL page + makeDirectories destination + B.writeFile destination (getBody page) + -- Make pages renderable. instance Renderable Page where getDependencies = (:[]) . flip addExtension ".html" . dropExtension . getPageURL diff --git a/src/Text/Hakyll/Render.hs b/src/Text/Hakyll/Render.hs index daca5b1..a94ac2d 100644 --- a/src/Text/Hakyll/Render.hs +++ b/src/Text/Hakyll/Render.hs @@ -1,6 +1,5 @@ module Text.Hakyll.Render ( depends, - writePage, render, renderAndConcat, renderChain, @@ -29,13 +28,6 @@ depends file dependencies action = do valid <- isCacheValid (toDestination file) dependencies unless valid action --- | Write a page to the site destination. -writePage :: Page -> IO () -writePage page = do - let destination = toDestination $ getURL page - makeDirectories destination - B.writeFile destination (getBody page) - -- | Render to a Page. render :: Renderable a => FilePath -- ^ Template to use for rendering. |
