summaryrefslogtreecommitdiff
path: root/src/Hakyll/Web/Page.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-02-09 18:11:24 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-02-09 18:11:24 +0100
commit002cf4de32db979d515c2a9cdcd8c8f42859a797 (patch)
tree6992a3f05e693116ae6802ef48448a5a03aded1e /src/Hakyll/Web/Page.hs
parent7da7e0b96c245a14122896c24dcee52f038e583a (diff)
downloadhakyll-002cf4de32db979d515c2a9cdcd8c8f42859a797.tar.gz
Add hamlet templates and restructure tests
Diffstat (limited to 'src/Hakyll/Web/Page.hs')
-rw-r--r--src/Hakyll/Web/Page.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Hakyll/Web/Page.hs b/src/Hakyll/Web/Page.hs
index a7c237a..c7de026 100644
--- a/src/Hakyll/Web/Page.hs
+++ b/src/Hakyll/Web/Page.hs
@@ -6,6 +6,7 @@
module Hakyll.Web.Page
( Page (..)
, fromBody
+ , fromMap
, toMap
, pageRead
, addDefaultFields
@@ -15,6 +16,7 @@ import Prelude hiding (id)
import Control.Category (id)
import Control.Arrow ((>>^), (&&&), (>>>))
import System.FilePath (takeBaseName, takeDirectory)
+import Data.Monoid (Monoid, mempty)
import Data.Map (Map)
import qualified Data.Map as M
@@ -30,6 +32,11 @@ import Hakyll.Web.Util.String
fromBody :: a -> Page a
fromBody = Page M.empty
+-- | 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