@@ -6,6 +6,7 @@ module Hakyll.Core.Compiler
6 , runCompiler
6 , runCompiler
7 , getIdentifier
7 , getIdentifier
9 , getResourceString
10 , getResourceString
10 , fromDependency
11 , fromDependency
11 , require_
12 , require_
@@ -74,8 +75,12 @@ getIdentifier = fromJob $ const $ CompilerM $ compilerIdentifier <$> ask
74-- | Get the route we are using for this item
75-- | Get the route we are using for this item
76getRoute :: Compiler a (Maybe FilePath)
77getRoute :: Compiler a (Maybe FilePath)
78+getRoute = getIdentifier >>> getRouteFor
80+-- | Get the route for a specified item
82+getRouteFor :: Compiler Identifier (Maybe FilePath)
77−getRoute = fromJob $ const $ CompilerM $ do
83+getRouteFor = fromJob $ \identifier -> CompilerM $ do
78− identifier <- compilerIdentifier <$> ask
79 routes <- compilerRoutes <$> ask
84 routes <- compilerRoutes <$> ask
80 return $ runRoutes routes identifier
85 return $ runRoutes routes identifier