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

Commit 5faaffe51bf89fe94ab7a8fd1efab397d06ce0f7
Parent: 55bdba12d16998b11c69ce47b31d4cca9cfd0064
Author: mcol <mcol@posteo.net>
Date: 2022-04-25 20:59:58 +0100
Committer: mcol <mcol@posteo.net>
Committed: 2022-04-25 20:59:58 +0100

use hashmap insert instead of mappend

src/Templates.hs Modified

@@ -60,10 +60,10 @@
 -}
 generate ::
     Path Abs File ->
-    HashMap.HashMap T.Text (GVal RunRepo) ->
     Template ->
+    HashMap.HashMap T.Text (GVal RunRepo) ->
     ReaderT LgRepo IO ()
-generate output context template = do
+generate output template context = do
     let output' = toFilePath output
     liftIO . ignoringAbsence . removeFile $ output'
     content <- liftIO . newIORef . TB.fromText $ ""

src/Repositories.hs Modified

@@ -375,7 +375,7 @@
     Template ->
     ReaderT LgRepo IO ()
 genRepo output scope template =
-    generate (output </> templatePath template) scope template
+    generate (output </> templatePath template) template scope
 
 ----------------------------------------------------------------------------------------
 -- Targets -----------------------------------------------------------------------------
@@ -409,5 +409,4 @@
     exists <- liftIO . doesFileExist $ output'
     when (force || not exists) $ do
         liftIO . unless quiet . putStrLn $ "Writing " <> toFilePath output'
-        let scope' = scope <> HashMap.fromList [(category, toGVal target)]
-        generate output' scope' template
+        generate output' template $ HashMap.insert category (toGVal target) scope