on master help sign in
Again an url mistake, now the simpleblog works too.
66ad9ceJasper Van der Jeugt
src/Text/Hakyll/Render.hs+1−1
@@ -89,7 +89,7 @@ renderAndConcatWith manipulation templatePaths renderables = RenderAction
89 renders = map (>>> manipulationAction >>> render') renderables
89 renders = map (>>> manipulationAction >>> render') renderables
90 manipulationAction = createManipulationAction manipulation
90 manipulationAction = createManipulationAction manipulation
91
91
92− actionFunction' = \_ -> do
92+ actionFunction' _ = do
93 contexts <- mapM runRenderAction renders
93 contexts <- mapM runRenderAction renders
94 return $ concatMap (fromMaybe "" . M.lookup "body") contexts
94 return $ concatMap (fromMaybe "" . M.lookup "body") contexts
95
95
src/Text/Hakyll/RenderAction.hs+2−3
@@ -28,7 +28,7 @@ createRenderAction f = RenderAction
28 }
28 }
29
29
30createSimpleRenderAction :: Hakyll b -> RenderAction () b
30createSimpleRenderAction :: Hakyll b -> RenderAction () b
31−createSimpleRenderAction x = createRenderAction (const x)
31+createSimpleRenderAction = createRenderAction . const
32
32
33instance Category RenderAction where
33instance Category RenderAction where
34 id = RenderAction
34 id = RenderAction
@@ -44,8 +44,7 @@ instance Category RenderAction where
44 }
44 }
45
45
46createManipulationAction :: ContextManipulation -> RenderAction Context Context
46createManipulationAction :: ContextManipulation -> RenderAction Context Context
47−createManipulationAction manipulation =
47+createManipulationAction = createRenderAction . (return .)
48− createRenderAction (return . manipulation)
49
48
50chain :: [RenderAction a a] -> RenderAction a a
49chain :: [RenderAction a a] -> RenderAction a a
51chain = foldl1 (>>>)
50chain = foldl1 (>>>)
src/Text/Hakyll/Renderables.hs+3−3
@@ -40,7 +40,7 @@ createCustomPage url dependencies association = RenderAction
40 where
40 where
41 mtuple (a, b) = b >>= \b' -> return (a, b')
41 mtuple (a, b) = b >>= \b' -> return (a, b')
42 toHakyllString = second (either return runRenderAction)
42 toHakyllString = second (either return runRenderAction)
43− assoc' = mapM (mtuple . toHakyllString) association
43+ assoc' = mapM (mtuple . toHakyllString) $ ("url", Left url) : association
44
44
45-- | A @createCustomPage@ function specialized in creating listings.
45-- | A @createCustomPage@ function specialized in creating listings.
46--
46--
@@ -110,7 +110,7 @@ combine x y = RenderAction
110 { actionDependencies = actionDependencies x ++ actionDependencies y
110 { actionDependencies = actionDependencies x ++ actionDependencies y
111 , actionUrl = actionUrl x `mplus` actionUrl y
111 , actionUrl = actionUrl x `mplus` actionUrl y
112 , actionFunction = \_ ->
112 , actionFunction = \_ ->
113− liftM2 (M.union) (runRenderAction x) (runRenderAction y)
113+ liftM2 M.union (runRenderAction x) (runRenderAction y)
114 }
114 }
115
115
116-- | Combine two renderables and set a custom URL. This behaves like @combine@,
116-- | Combine two renderables and set a custom URL. This behaves like @combine@,
@@ -122,7 +122,7 @@ combineWithUrl :: FilePath
122combineWithUrl url x y = combine'
122combineWithUrl url x y = combine'
123 { actionUrl = Just $ return url
123 { actionUrl = Just $ return url
124 , actionFunction = \_ ->
124 , actionFunction = \_ ->
125− (M.insert "url" url) <$> runRenderAction combine'
125+ M.insert "url" url <$> runRenderAction combine'
126 }
126 }
127 where
127 where
128 combine' = combine x y
128 combine' = combine x y