diff options
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Hakyll/Page.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Text/Hakyll/Page.hs b/src/Text/Hakyll/Page.hs index f70d898..c5ddc3a 100644 --- a/src/Text/Hakyll/Page.hs +++ b/src/Text/Hakyll/Page.hs @@ -10,6 +10,8 @@ import qualified Data.Map as M import qualified Data.List as L import Data.Maybe (fromMaybe) +import Control.Parallel.Strategies (rnf, ($|)) + import System.FilePath (FilePath, takeExtension) import System.IO @@ -110,13 +112,14 @@ readPage pagePath = do -- Render file let rendered = (renderFunction $ takeExtension path) body - seq rendered $ hClose handle - let page = fromContext $ M.fromList $ + page = fromContext $ M.fromList $ [ ("body", rendered) , ("url", url) , ("path", pagePath) ] ++ context + seq (($|) id rnf rendered) $ hClose handle + -- Cache if needed if getFromCache then return () else cachePage page return page |