From 47586163d2c38aa32ef4c106ebceca9fbf67325a Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sun, 14 Mar 2010 22:19:07 +0100 Subject: Added renderBody function. --- src/Text/Hakyll/ContextManipulations.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) 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" -- cgit v1.2.3