summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/CreateContext.hs
diff options
context:
space:
mode:
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@.
--