on master help sign in
Run metacompilers instead of ignoring them
commit7bf3450caf5900a5a3f11c0358dbffbf72f5ef1a authorJasper Van der Jeugt <jaspervdj@gmail.com> dateFri 7 Jan 2011, 14:48 (16 years ago) parent1bf95c0
1 file changed+20−14
src/Hakyll/Core/Run.hs+20−14
src/Hakyll/Core/Run.hs+20−14
@@ -141,17 +141,23 @@ runCompilers ((id', compiler) : compilers) = Hakyll $ do
141141 result <- liftIO $ runCompiler compiler id' provider url store isModified
142142 liftIO $ putStrLn $ "Generated target: " ++ show id'
143143
144− let CompileRule compiled = result
145−
146− case url of
147− Nothing -> return ()
148− Just r -> liftIO $ do
149− putStrLn $ "Routing " ++ show id' ++ " to " ++ r
150− let path = "_site" </> r
151− makeDirectories path
152− write path compiled
153−
154− liftIO $ putStrLn ""
155−
156− -- Continue for the remaining compilers
157− unHakyll $ runCompilers compilers
144+ case result of
145+ -- Compile rule for one item, easy stuff
146+ CompileRule compiled -> do
147+ case url of
148+ Nothing -> return ()
149+ Just r -> liftIO $ do
150+ putStrLn $ "Routing " ++ show id' ++ " to " ++ r
151+ let path = "_site" </> r
152+ makeDirectories path
153+ write path compiled
154+
155+ liftIO $ putStrLn ""
156+
157+ -- Continue for the remaining compilers
158+ unHakyll $ runCompilers compilers
159+
160+ -- Metacompiler, slightly more complicated
161+ MetaCompileRule newCompilers -> do
162+ -- Actually I was just kidding, it's not hard at all
163+ unHakyll $ addNewCompilers compilers newCompilers