on fb71a21 help sign in
hakyll/src/Text/Hakyll/Renderable.hs
18 lines 541 B history raw
1module Text.Hakyll.Renderable
2 ( Renderable(toContext, getDependencies, getURL)
3 ) where
5import System.FilePath (FilePath)
6import Text.Template (Context)
8-- | A class for datatypes that can be rendered to pages.
9class Renderable a where
10 -- | Get a context to do substitutions with.
11 toContext :: a -> IO Context
13 -- | Get the dependencies for the renderable. This is used for cache
14 -- invalidation.
15 getDependencies :: a -> [FilePath]
17 -- | Get the destination for the renderable.
18 getURL :: a -> FilePath