diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-02-26 15:49:11 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2011-02-26 15:49:11 +0100 |
commit | 5c454fc2ced8364e000f8c9cc36387e39e001714 (patch) | |
tree | 59630d5dd2e19162cccba2381b54a2d052b49bd5 /src/Hakyll/Web/Page/Internal.hs | |
parent | ed12fd21200bad030eeb8d2ccf2d0acdbdc73949 (diff) | |
download | hakyll-5c454fc2ced8364e000f8c9cc36387e39e001714.tar.gz |
Fix $body$ bug, add `traceShowCompiler`
Diffstat (limited to 'src/Hakyll/Web/Page/Internal.hs')
-rw-r--r-- | src/Hakyll/Web/Page/Internal.hs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Hakyll/Web/Page/Internal.hs b/src/Hakyll/Web/Page/Internal.hs index dd47197..55067ed 100644 --- a/src/Hakyll/Web/Page/Internal.hs +++ b/src/Hakyll/Web/Page/Internal.hs @@ -3,6 +3,8 @@ {-# LANGUAGE DeriveDataTypeable #-} module Hakyll.Web.Page.Internal ( Page (..) + , fromMap + , toMap ) where import Control.Applicative ((<$>), (<*>)) @@ -36,3 +38,13 @@ instance Binary a => Binary (Page a) where instance Writable a => Writable (Page a) where write p (Page _ b) = write p b + +-- | Create a metadata page, without a body +-- +fromMap :: Monoid a => Map String String -> Page a +fromMap m = Page m mempty + +-- | Convert a page to a map. The body will be placed in the @body@ key. +-- +toMap :: Page String -> Map String String +toMap (Page m b) = M.insert "body" b m |