summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Compiler.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2013-02-24 11:37:24 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2013-02-24 11:37:24 +0100
commit151c142960d41833f72d0ac06ee5710a42639384 (patch)
tree2e332303a581f694169aa3aedfc5e06975959efd /src/Hakyll/Core/Compiler.hs
parent5ec7f26b2995b45e17cf8e9a459004d8a7044e1b (diff)
parent4c40cea9e1ddef01e25f135656551ef8d494cffb (diff)
downloadhakyll-151c142960d41833f72d0ac06ee5710a42639384.tar.gz
Merge branch 'dev-metadata-route'
Diffstat (limited to 'src/Hakyll/Core/Compiler.hs')
-rw-r--r--src/Hakyll/Core/Compiler.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Hakyll/Core/Compiler.hs b/src/Hakyll/Core/Compiler.hs
index b23b69b..b711719 100644
--- a/src/Hakyll/Core/Compiler.hs
+++ b/src/Hakyll/Core/Compiler.hs
@@ -39,6 +39,7 @@ import System.FilePath (takeExtension)
--------------------------------------------------------------------------------
import Hakyll.Core.Compiler.Internal
import qualified Hakyll.Core.Compiler.Require as Internal
+import Hakyll.Core.Dependencies
import Hakyll.Core.Identifier
import Hakyll.Core.Item
import Hakyll.Core.Logger as Logger
@@ -71,8 +72,12 @@ makeItem x = do
-- | Get the route for a specified item
getRoute :: Identifier -> Compiler (Maybe FilePath)
getRoute identifier = do
- routes <- compilerRoutes <$> compilerAsk
- return $ runRoutes routes identifier
+ provider <- compilerProvider <$> compilerAsk
+ routes <- compilerRoutes <$> compilerAsk
+ -- Note that this makes us dependend on that identifier: when the metadata
+ -- of that item changes, the route may change, hence we have to recompile
+ compilerTellDependencies [IdentifierDependency identifier]
+ compilerUnsafeIO $ runRoutes routes provider identifier
--------------------------------------------------------------------------------