summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/CreateContext.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-10-04 01:20:17 +0200
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-10-04 01:20:17 +0200
commit08c4d74a2fe9c667e725f2ebb41bc01006a703a1 (patch)
tree4134171be17ce36ca109b7fc72d574a5c2113308 /src/Text/Hakyll/CreateContext.hs
parentcd246971582639666bb1afe1b51bbd3db1ac744a (diff)
downloadhakyll-08c4d74a2fe9c667e725f2ebb41bc01006a703a1.tar.gz
Separate pandoc from page reading, general caching
Diffstat (limited to 'src/Text/Hakyll/CreateContext.hs')
-rw-r--r--src/Text/Hakyll/CreateContext.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Text/Hakyll/CreateContext.hs b/src/Text/Hakyll/CreateContext.hs
index a38d055..d9499ea 100644
--- a/src/Text/Hakyll/CreateContext.hs
+++ b/src/Text/Hakyll/CreateContext.hs
@@ -13,21 +13,19 @@ import qualified Data.Map as M
import Control.Arrow (second)
import Control.Monad (liftM2)
import Control.Applicative ((<$>))
+import Control.Arrow ((>>>))
-import Text.Hakyll.File
import Text.Hakyll.Context
import Text.Hakyll.HakyllAction
import Text.Hakyll.Render
import Text.Hakyll.Internal.Page
+import Text.Hakyll.Pandoc
+import Text.Hakyll.Internal.Cache
-- | Create a @Context@ from a page file stored on the disk. This is probably
-- the most common way to create a @Context@.
createPage :: FilePath -> HakyllAction () Context
-createPage path = HakyllAction
- { actionDependencies = [path]
- , actionUrl = Left $ toUrl path
- , actionFunction = const (readPage path)
- }
+createPage path = cacheAction "pages" $ readPageAction path >>> renderAction
-- | Create a "custom page" @Context@.
--