summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-03-14 22:19:07 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-03-14 22:19:07 +0100
commit47586163d2c38aa32ef4c106ebceca9fbf67325a (patch)
tree67f30b895b8f0dc0915b693f2ed0ed99bf532fa5
parent9acf269cea78f953d52d92e648177605c228b35f (diff)
downloadhakyll-47586163d2c38aa32ef4c106ebceca9fbf67325a.tar.gz
Added renderBody function.
-rw-r--r--src/Text/Hakyll/ContextManipulations.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Text/Hakyll/ContextManipulations.hs b/src/Text/Hakyll/ContextManipulations.hs
index 9f95232..9409721 100644
--- a/src/Text/Hakyll/ContextManipulations.hs
+++ b/src/Text/Hakyll/ContextManipulations.hs
@@ -6,6 +6,7 @@ module Text.Hakyll.ContextManipulations
, copyValue
, renderDate
, changeExtension
+ , renderBody
) where
import Control.Arrow (arr)
@@ -80,3 +81,13 @@ changeExtension :: String -- ^ Extension to change to.
changeExtension extension = changeValue "url" changeExtension'
where
changeExtension' = flip addExtension extension . dropExtension
+
+-- | Change the body of a file using a certain manipulation.
+--
+-- > import Data.Char (toUpper)
+-- > renderBody (map toUpper)
+--
+-- Will put the entire body of the page in UPPERCASE.
+renderBody :: (String -> String)
+ -> HakyllAction Context Context
+renderBody = renderValue "body" "body"