summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Internal
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-03-04 22:37:50 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-03-04 22:37:50 +0100
commit6b4b8064cdd0476883a2db0780302b2a17f3164f (patch)
tree84b7dcb7455a362c4ab1279d7dc65dd8ac4b9922 /src/Text/Hakyll/Internal
parent11996929aae640c9cd3737fdb2736e6562c705de (diff)
downloadhakyll-6b4b8064cdd0476883a2db0780302b2a17f3164f.tar.gz
Fixed url inclusion bug. Brochure example works now.
Diffstat (limited to 'src/Text/Hakyll/Internal')
-rw-r--r--src/Text/Hakyll/Internal/Page.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Text/Hakyll/Internal/Page.hs b/src/Text/Hakyll/Internal/Page.hs
index 4adddc5..ceabb02 100644
--- a/src/Text/Hakyll/Internal/Page.hs
+++ b/src/Text/Hakyll/Internal/Page.hs
@@ -19,11 +19,12 @@ import Test.QuickCheck
import Text.Pandoc
import Data.Binary
-import Text.Hakyll.Internal.Cache
-import Text.Hakyll.Hakyll
-import Text.Hakyll.Util (trim)
import Text.Hakyll.Context (Context)
+import Text.Hakyll.File
+import Text.Hakyll.Hakyll
import Text.Hakyll.Regex (substituteRegex, matchesRegex)
+import Text.Hakyll.Util (trim)
+import Text.Hakyll.Internal.Cache
-- | A Page is basically key-value mapping. Certain keys have special
-- meanings, like for example url, body and title.
@@ -121,9 +122,10 @@ readPageFromFile path = do
-- Read file.
contents <- liftIO $ readFile path
+ url <- toUrl path
let sections = splitAtDelimiters $ lines contents
sectionsData = concat $ zipWith ($) sectionFunctions sections
- context = M.fromList $ category ++ sectionsData
+ context = M.fromList $ ("url", url) : category ++ sectionsData
return context
where