summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Target.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-12-25 22:02:20 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-12-25 22:02:20 +0100
commitec85de418b01b4eaefb286a52c050a141204d46f (patch)
tree09920771d52169533b477b17903a784c000ee5b6 /src/Hakyll/Core/Target.hs
parent0cd7716dae87d50e79883152edf735132ae4798e (diff)
downloadhakyll-ec85de418b01b4eaefb286a52c050a141204d46f.tar.gz
Prototype Run module
Diffstat (limited to 'src/Hakyll/Core/Target.hs')
-rw-r--r--src/Hakyll/Core/Target.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Hakyll/Core/Target.hs b/src/Hakyll/Core/Target.hs
index 1f783df..215a53b 100644
--- a/src/Hakyll/Core/Target.hs
+++ b/src/Hakyll/Core/Target.hs
@@ -6,6 +6,20 @@ module Hakyll.Core.Target
, TargetM
, Target
, runTarget
+ , getResourceString
) where
+import Control.Applicative ((<$>))
+import Control.Monad.Reader (ask)
+import Control.Monad.Trans (liftIO)
+
import Hakyll.Core.Target.Internal
+import Hakyll.Core.ResourceProvider
+
+-- | Get the resource content as a string
+--
+getResourceString :: TargetM a String
+getResourceString = TargetM $ do
+ provider <- targetResourceProvider <$> ask
+ identifier <- targetIdentifier <$> ask
+ liftIO $ resourceString provider identifier