@@ -11,8 +11,11 @@ module Text.Hakyll.Page
1111
1212import qualified Data.Map as M
1313import qualified Data.List as L
14−import System.FilePath
1514import Data.Maybe
15+
16+import System.FilePath
17+import System.IO
18+
1619import Text.Pandoc
1720
1821-- | A Page is basically key-value mapping. Certain keys have special
@@ -57,7 +60,9 @@ markdownToHTML = writeHtmlString writerOptions .
5760-- pages are not templates, so they should not contain $identifiers.
5861readPage :: FilePath -> IO Page
5962readPage path = do
60− content <- readFile path
63+ handle <- openFile path ReadMode
64+ content <- hGetContents handle
65+ seq content $ hClose handle
6166 let context = extractContext content
6267 body = (if takeExtension path == ".markdown" then markdownToHTML else id)
6368 (getBody context)