summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Renderables.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-02-01 16:43:26 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-02-01 16:43:26 +0100
commitc4b1fd5900bdff5c94891b7b1c9e764653d572a3 (patch)
tree578ed9966565a5642de4531d65786a58cd2ccac5 /src/Text/Hakyll/Renderables.hs
parentfbd9ff95bdd9c9bd904d87f2b2f2d88470c68173 (diff)
downloadhakyll-c4b1fd5900bdff5c94891b7b1c9e764653d572a3.tar.gz
Added indexUrl option - experimental.
This option will render, for example, about.html to about/index.html. This way, url's will generally look more pretty.
Diffstat (limited to 'src/Text/Hakyll/Renderables.hs')
-rw-r--r--src/Text/Hakyll/Renderables.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Hakyll/Renderables.hs b/src/Text/Hakyll/Renderables.hs
index 6f5bcfe..0ccef5f 100644
--- a/src/Text/Hakyll/Renderables.hs
+++ b/src/Text/Hakyll/Renderables.hs
@@ -85,7 +85,7 @@ createListingWith manipulation url template renderables additional =
instance Renderable CustomPage where
getDependencies = customPageDependencies
- getUrl = customPageUrl
+ getUrl = return . customPageUrl
toContext page = do
values <- mapM (either return id . snd) (customPageContext page)
let pairs = zip (map fst $ customPageContext page) values
@@ -94,6 +94,7 @@ instance Renderable CustomPage where
-- | PagePath is a class that wraps a FilePath. This is used to render Pages
-- without reading them first through use of caching.
data PagePath = PagePath FilePath
+ deriving (Ord, Eq, Read, Show)
-- | Create a PagePath from a FilePath.
createPagePath :: FilePath -> PagePath
@@ -113,6 +114,7 @@ instance Binary PagePath where
-- | A combination of two other renderables.
data CombinedRenderable a b = CombinedRenderable a b
| CombinedRenderableWithUrl FilePath a b
+ deriving (Ord, Eq, Read, Show)
-- | Combine two renderables. The url will always be taken from the first
-- @Renderable@. Also, if a `$key` is present in both renderables, the
@@ -144,7 +146,7 @@ instance (Renderable a, Renderable b)
-- Take the url from the first renderable, or the specified URL.
getUrl (CombinedRenderable a _) = getUrl a
- getUrl (CombinedRenderableWithUrl url _ _) = url
+ getUrl (CombinedRenderableWithUrl url _ _) = return url
-- Take a union of the contexts.
toContext (CombinedRenderable a b) = do