diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-03-14 22:19:07 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-03-14 22:19:07 +0100 |
commit | 47586163d2c38aa32ef4c106ebceca9fbf67325a (patch) | |
tree | 67f30b895b8f0dc0915b693f2ed0ed99bf532fa5 /src/Text/Hakyll/ContextManipulations.hs | |
parent | 9acf269cea78f953d52d92e648177605c228b35f (diff) | |
download | hakyll-47586163d2c38aa32ef4c106ebceca9fbf67325a.tar.gz |
Added renderBody function.
Diffstat (limited to 'src/Text/Hakyll/ContextManipulations.hs')
-rw-r--r-- | src/Text/Hakyll/ContextManipulations.hs | 11 |
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" |