summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-19 09:15:39 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-19 09:15:39 +0100
commitda31280dd7c93499327e149af9679806d1a09e46 (patch)
treedd3e8a60b7feec44ffa6a14ad56c76d1747c45c7
parent271e7a386d9f49c2e8125ab8f3cfb440efca7eb4 (diff)
downloadhakyll-da31280dd7c93499327e149af9679806d1a09e46.tar.gz
Unicode is a bitch.
I am leaving a character in one of the examples, so we would notice it directly, should we ever break it again.
-rw-r--r--examples/brochure/about.markdown2
-rw-r--r--hakyll.cabal3
-rw-r--r--src/Text/Hakyll/Page.hs19
-rw-r--r--src/Text/Hakyll/Render/Internal.hs3
4 files changed, 12 insertions, 15 deletions
diff --git a/examples/brochure/about.markdown b/examples/brochure/about.markdown
index 410cb10..247cb83 100644
--- a/examples/brochure/about.markdown
+++ b/examples/brochure/about.markdown
@@ -5,7 +5,7 @@ Nullam imperdiet sodales orci vitae molestie. Nunc quam orci, pharetra a
rhoncus vitae, eleifend id felis. Suspendisse potenti. Etiam vitae urna orci.
Quisque pellentesque dignissim felis, egestas tempus urna luctus vitae. In hac
habitasse platea dictumst. Morbi fringilla mattis odio, et mattis tellus
-accumsan vitae.
+accumsan vitae. 碁
Vivamus eget mauris sit amet nulla laoreet lobortis. Nulla in diam elementum
risus convallis commodo. Cras vehicula varius dui vitae facilisis. Proin
diff --git a/hakyll.cabal b/hakyll.cabal
index f1f9aae..bdba45d 100644
--- a/hakyll.cabal
+++ b/hakyll.cabal
@@ -34,8 +34,7 @@ library
mtl >= 1.1,
old-locale >= 1,
time >= 1,
- parallel >= 2,
- utf8-string >= 0.3
+ parallel >= 2
exposed-modules: Text.Hakyll
Text.Hakyll.Hakyll
Text.Hakyll.Render
diff --git a/src/Text/Hakyll/Page.hs b/src/Text/Hakyll/Page.hs
index b58ea0f..6571d96 100644
--- a/src/Text/Hakyll/Page.hs
+++ b/src/Text/Hakyll/Page.hs
@@ -12,8 +12,7 @@ import Data.Maybe (fromMaybe)
import Control.Parallel.Strategies (rdeepseq, ($|))
import Control.Monad.Reader (liftIO)
import System.FilePath (takeExtension)
-import System.IO (IOMode(..), openFile, hClose)
-import qualified System.IO.UTF8 as U
+import System.IO
import Text.Pandoc
@@ -93,18 +92,18 @@ cachePage page@(Page mapping) = do
writePageToCache = do
handle <- openFile destination WriteMode
- U.hPutStrLn handle "---"
+ hPutStrLn handle "---"
mapM_ (writePair handle) $ M.toList simpleMetaData
mapM_ (writeSection handle) $ M.toList sectionMetaData
- U.hPutStrLn handle "---"
- U.hPutStrLn handle $ getBody page
+ hPutStrLn handle "---"
+ hPutStrLn handle $ getBody page
hClose handle
- writePair h (k, v) = do U.hPutStr h $ k ++ ": " ++ v
- U.hPutStrLn h ""
+ writePair h (k, v) = do hPutStr h $ k ++ ": " ++ v
+ hPutStrLn h ""
- writeSection h (k, v) = do U.hPutStrLn h $ "--- " ++ k
- U.hPutStrLn h v
+ writeSection h (k, v) = do hPutStrLn h $ "--- " ++ k
+ hPutStrLn h v
destination = toCache $ getURL page
@@ -147,7 +146,7 @@ readPage pagePath = do
-- Read file.
handle <- liftIO $ openFile path ReadMode
sections <- fmap (splitAtDelimiters . lines )
- (liftIO $ U.hGetContents handle)
+ (liftIO $ hGetContents handle)
let context = concat $ zipWith ($) sectionFunctions sections
page = fromContext $ M.fromList $
diff --git a/src/Text/Hakyll/Render/Internal.hs b/src/Text/Hakyll/Render/Internal.hs
index b6810bb..d4c1697 100644
--- a/src/Text/Hakyll/Render/Internal.hs
+++ b/src/Text/Hakyll/Render/Internal.hs
@@ -16,7 +16,6 @@ import Data.List (isPrefixOf, foldl')
import Data.Char (isAlpha)
import Data.Maybe (fromMaybe)
import Control.Parallel.Strategies (rdeepseq, ($|))
-import qualified System.IO.UTF8 as U
import Text.Hakyll.Renderable
import Text.Hakyll.Page
@@ -90,6 +89,6 @@ writePage page = do
context = additionalContext' `M.union` (M.singleton "root" $ toRoot url)
makeDirectories destination
    -- Substitute $root here, just before writing.
- liftIO $ U.writeFile destination $ finalSubstitute (getBody page) context
+ liftIO $ writeFile destination $ finalSubstitute (getBody page) context
where
url = getURL page