🐙 Templated web page generator for your git repositories
git clone https://github.com/m-col/gitja
Files | Refs | Readme | License

Commit 244316a3583c67556840c5bc30fa8d3d1e178b5e
Parent: ce512267067055e0e77d85262f973030bde79a4e
Author: mcol <mcol@posteo.net>
Date: 2021-09-18 18:40:19 +0100
Committer: mcol <mcol@posteo.net>
Committed: 2021-09-18 18:40:19 +0100

Pass templates to processRepo

src/Repositories.hs Modified

@@ -15,10 +15,11 @@
 
 {-
 This is the entrypoint that receives the ``Config`` and uses it to map over our
-repositories, reading from them and writing out their web pages.
+repositories, reading from them and writing out their web pages using the given
+templates.
 -}
 run :: Config -> [Template] -> IO ()
-run config templates = foldMap processRepo . repoPaths $ config
+run config templates = foldMap (processRepo templates) . repoPaths $ config
 
 ----------------------------------------------------------------------------------------
 
@@ -27,8 +28,8 @@
 repository doesn't exist or is unreadable in any way we can forget about it and move on
 (after informing the user of course).
 -}
-processRepo :: FilePath -> IO ()
-processRepo path = withRepository lgFactory path $ do
+processRepo :: [Template] -> FilePath -> IO ()
+processRepo templates path = withRepository lgFactory path $ do
     maybeObjID <- resolveReference "HEAD"
     case maybeObjID of
         Just commitID -> do