diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-10-04 01:20:17 +0200 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-10-04 01:20:17 +0200 |
commit | 08c4d74a2fe9c667e725f2ebb41bc01006a703a1 (patch) | |
tree | 4134171be17ce36ca109b7fc72d574a5c2113308 /src/Text/Hakyll/CreateContext.hs | |
parent | cd246971582639666bb1afe1b51bbd3db1ac744a (diff) | |
download | hakyll-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.hs | 10 |
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@. -- |