@@ -11,18 +11,18 @@ module Text.Hakyll.Renderables
1111
1212import qualified Data.Map as M
1313import Control.Arrow (second)
14−import Control.Monad (liftM, liftM2, mplus)
14+import Control.Monad (liftM2, mplus)
1515import Control.Applicative ((<$>))
1616
1717import Data.Binary
1818
1919import Text.Hakyll.Hakyll (Hakyll)
20−import Text.Hakyll.Page
2120import Text.Hakyll.Renderable
2221import Text.Hakyll.File
2322import Text.Hakyll.Context
2423import Text.Hakyll.Render
2524import Text.Hakyll.RenderAction
25+import Text.Hakyll.Internal.Page
2626
2727-- | Create a custom page.
2828--
@@ -90,19 +90,12 @@ newtype PagePath = PagePath FilePath
9090 deriving (Ord, Eq, Read, Show)
9191
9292-- | Create a PagePath from a FilePath.
93−createPagePath :: FilePath -> PagePath
94−createPagePath = PagePath
95−
96−-- We can render filepaths
97−instance Renderable PagePath where
98− getDependencies (PagePath path) = return path
99− getUrl (PagePath path) = toUrl path
100− toContext (PagePath path) = readPage path >>= toContext
101−
102−-- We can serialize filepaths
103−instance Binary PagePath where
104− put (PagePath path) = put path
105− get = liftM PagePath get
93+createPagePath :: FilePath -> RenderAction () Context
94+createPagePath path = RenderAction
95+ { actionDependencies = [path]
96+ , actionDestination = Just $ toUrl path
97+ , actionFunction = const (readPage path)
98+ }
10699
107100-- | A combination of two other renderables.
108101data CombinedRenderable a b = CombinedRenderable a b