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

Commit d75a1ede4dcf34c7022b621afe3e9d238807e20a
Parent: f92c012b5251e34cf712c27790ddf690ae23ab7b
Author: mcol <mcol@posteo.net>
Date: 2021-09-19 21:51:54 +0100
Committer: mcol <mcol@posteo.net>
Committed: 2021-09-19 21:53:15 +0100

Specify repo name, as variable that can be passed later to ginger

src/Repositories.hs Modified

@@ -40,14 +40,15 @@
     liftIO $ createDirectoryIfMissing True outPath
     ref <- resolveReference "HEAD"
     case ref of
-        Nothing -> liftIO . print $ "gitserve: " <> (takeFileName path) <> ": Failed to resolve HEAD."
+        Nothing -> liftIO . print $ "gitserve: " <> name <> ": Failed to resolve HEAD."
         Just commitID -> do
             description <- liftIO $ getDescription $ outPath </> "description"
             head <- lookupCommit (Tagged commitID)
             nodes <- lookupTree (commitTree head) >>= listTreeEntries
             return ()
   where
-    outPath = outputDirectory </> (takeFileName path)
+    name = takeFileName path
+    outPath = outputDirectory </> name
 
     --mconcat $ runGingerT (makeContextHtmlM (scopeLookup context) (putStr . unpack . htmlSource)) tpl
 
@@ -58,7 +59,4 @@
         Left err -> return Nothing
 
 -- Variables:
---title = "gitserve"
---description = ""
 --host = "http://localhost"
---path = ""