summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Renderable.hs
blob: cafdb3cebe4431d654e748428231fbe0b121094d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Text.Hakyll.Renderable
    ( Renderable(toContext, getDependencies, getURL)
    ) where

import Text.Hakyll.Hakyll (Hakyll)
import System.FilePath (FilePath)
import Text.Hakyll.Context (Context)

-- | A class for datatypes that can be rendered to pages.
class Renderable a where
    -- | Get a context to do substitutions with.
    toContext :: a -> Hakyll Context

    -- | Get the dependencies for the renderable. This is used for cache
    --   invalidation.
    getDependencies :: a -> [FilePath]

    -- | Get the destination for the renderable.
    getURL :: a -> FilePath