From 6b4b8064cdd0476883a2db0780302b2a17f3164f Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Thu, 4 Mar 2010 22:37:50 +0100 Subject: Fixed url inclusion bug. Brochure example works now. --- src/Text/Hakyll/Internal/Page.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') 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 -- cgit v1.2.3