3 ms·
Ask HN: Tool(s) to render Git repository as static website
So this is hard to google, as almost everything points to hosting static websites on GitHub etc..
I am looking for a tool that can generate a static website from a git repository. E.g. generate a set of html files with some markup so I can present the contents of a git repository similar to the way GitHub/GitLab but as a static website for self-hosting. Nice to have all branches etc in there, but would already be nice to just have a single branch..
The goal would be to have a stand alone / static site for archival / offline use / inclusion in other static site (self-hosted). Being able to browse the code and download a zip file would be minimum. Viewing commits and perhaps generated diffs between certain commits would be a bonus.
Only thing I could find was stuff that converts just the wiki part of a GitHub repo. I am really looking for something that takes a .git repo and spits out some static website. Perhaps as a plugin for Jekyll/Hugo / ?? but stand alone would be just as good. Thx.
- mvdwoord 9y agoFinally found a magic word that gets me somewhere in the search engines... git2html. [Hypercubed/git2html](https://github.com/Hypercubed/git2html https://github.com/Hypercubed/git2html) is the first hit. reading as we speak. Any alternatives / experience greatly appreciated though. Can't find anything else really, and most discussions are years old. Anyone?
- billconan 9y agoyou can try doxygen. It generates class list and file list.
- vaibhavsagar 9y agoSomebody posted [Stagit](https://git.codemadness.org/stagit/ https://git.codemadness.org/stagit/) to HN a while ago, which seems to fit your description.
- mvdwoord 9y agoPerfect!! Thanks, I will check it out.
- williamdclt 9y agoGit comes with a `git instaweb` command, that allows to visualize a repo. Which seems... completely broken. The web server does launch at localhost:1234, but accessing this URL shows a HTTP 500 error on my two machines, whatever the repo (even on the git repo itself).
- mvdwoord 9y agoHaha, That is awesome! Seems the git learning curve never ends. Alas, it is a cgi file which dynamically generates the pages over lighttpd. Good to know though!!