Switching from Cgit to Legit
I have been using cgit1 for the web frontend at git.0x1b.me ever since I started self-hosting my own git repos. It’s a great project, and, as someone who -is- used to be quite comfortable with nginx, easy to setup. My only complaint is that it has been difficult to debug, which probably wouldn’t be true if I ever bothered to compile it myself. Otherwise, it’s difficult to troubleshoot changes in the config settings when I try to make changes that I am no doubt getting wrong. I never figured out how to get markdown in the READMEs to render.
My other desire is to customize the HTML and CSS, because, you know, it’s my site. cgit creates pages by writing small snippets of html source kind of like a reverse-PHP. That pattern is convenient for a C project, but makes the iteration little harder than filling out template files stored on disk.
legit2 immediately struck me by just how clean the interface looks. There is so much whitespace and so few design elements; it’s great. Furthermore it’s written in Go, which doesn’t affect the end result, but does mean that forking and modifying the repo is more within my skillset. It was pretty easy for me to add the few missing features I wanted:
- scanning nested directories and grouping by them
- downloading .tar.gz archives for Zig’s build system
- listening on a unix socket
- add section headers to some pages
Anyway, here are just a few before-and-after screenshots