@@ -6,6 +6,7 @@ module Hakyll.Core.Compiler
66 , runCompiler
77 , getIdentifier
88 , getRoute
9+ , getRouteFor
910 , getResourceString
1011 , fromDependency
1112 , require_
@@ -74,8 +75,12 @@ getIdentifier = fromJob $ const $ CompilerM $ compilerIdentifier <$> ask
7475-- | Get the route we are using for this item
7576--
7677getRoute :: Compiler a (Maybe FilePath)
77−getRoute = fromJob $ const $ CompilerM $ do
78− identifier <- compilerIdentifier <$> ask
78+getRoute = getIdentifier >>> getRouteFor
79+
80+-- | Get the route for a specified item
81+--
82+getRouteFor :: Compiler Identifier (Maybe FilePath)
83+getRouteFor = fromJob $ \identifier -> CompilerM $ do
7984 routes <- compilerRoutes <$> ask
8085 return $ runRoutes routes identifier
8186