Making cgit Pretty
Previously I wrote about how to install and configure cgit on Debian. If you have followed that short guide you now have a kick ass cgit install running on your server. So whats next? A bare cgit installation is pretty dull and there are some neat built in features that should be enabled for an optimal user experience. Open up /etc/cgitrc and made the following additions.
Configure Default README
You can set the default README for all repos by adding the following line.readme=master:README.md
This will tell cgit to look for the README.md file in your master branch for the default README for a given project.
Add an about filter
You can add an about filter which will add the about tab to your projects and display the README file configured in the previous step.about-filter=/usr/lib/cgit/filters/about-formatting.sh
Assuming that you have a README.md file in your master branch you will now see it in the about tab of your project.
Enable Syntax Highlighting
This is a no brainer. Adding syntax highlighting makes your code easier to look at on the website. This takes a few steps. First install the highlight package withsudo apt-get install highlight
. Next, open up/usr/lib/cgit/filters/syntax-highlighting.sh
and uncomment the last line that reads exec highlight --force -f -I -O xhtml -S "$EXTENSION" 2>/dev/null
Next, open up your stylesheet which should be found inusr/share/cgit/cgit.css
and add the following sections.
# Style definition file generated by highlight 2.4.8, http://www.andre-simon.de/ table.blob .num { color:#2928ff; } table.blob .esc { color:#ff00ff; } table.blob .str { color:#ff0000; } table.blob .dstr { color:#818100; } table.blob .slc { color:#838183; font-style:italic; } table.blob .com { color:#838183; font-style:italic; } table.blob .dir { color:#008200; } table.blob .sym { color:#000000; } table.blob .kwa { color:#000000; font-weight:bold; } table.blob .kwb { color:#830000; } table.blob .kwc { color:#000000; font-weight:bold; } table.blob .kwd { color:#010181; }# Style definition file generated by highlight 3.13, http://www.andre-simon.de/
body.hl { background-color:#e0eaee; } pre.hl { color:#000000; background-color:#e0eaee; font-size:10pt; font-family:‘Courier New’,monospace;} .hl.num { color:#b07e00; } .hl.esc { color:#ff00ff; } .hl.str { color:#bf0303; } .hl.pps { color:#818100; } .hl.slc { color:#838183; font-style:italic; } .hl.com { color:#838183; font-style:italic; } .hl.ppc { color:#008200; } .hl.opt { color:#000000; } .hl.ipl { color:#0057ae; } .hl.lin { color:#555555; } .hl.kwa { color:#000000; font-weight:bold; } .hl.kwb { color:#0057ae; } .hl.kwc { color:#000000; font-weight:bold; } .hl.kwd { color:#010181; }
source-filter=/usr/lib/cgit/filters/syntax-highlighting.sh
repo.url=my-repo repo.path=/srv/git/my-repo.git repo.readme=master:README.rst repo.about-filter=/usr/lib/cgit/filters/about-formatting.sh repo.desc=The best repo ever repo.owner=Your Name
Thank you for reading! Share your thoughts with me on bluesky, mastodon, or via email.
Check out some more stuff to read down below.
Most popular posts this month
- 2024
- Reinstalling Windows at 1am
- SQLite DB Migrations with PRAGMA user_version
- My Custom Miniflux CSS Theme
- How to Disable Wayland in Debian Testing
Recent Favorite Blog Posts
This is a collection of the last 8 posts that I bookmarked.
- 21st Century C++ from Communications of the ACM
- Submarines DevCon 2025 Keynote Speech from JoshHaines.com
- How I Use AI: Meet My Promptly Hired Model Intern from Armin Ronacher's Thoughts and Writings
- DeepSeek from Maggie Appleton
- Digital Reality Digital Shock from Christopher Butler
- 10 habits to help becoming a Debian Maintainer from Optimized by Otto
- Tiny corners from Manuel Moreale RSS Feed
- Build It Yourself from Armin Ronacher's Thoughts and Writings
Articles from blogs I follow around the net
Pluralistic: America and "national capitalism" (18 Feb 2025)
Today's links America and "national capitalism": How the EU should respond to Trumpism. Hey look at this: Delights to delectate. Object permanence: 2005, 2010, 2015 Upcoming appearances: Where to find me. Recent appearances: Where I've bee…
via Pluralistic: Daily links from Cory Doctorow February 18, 2025My Life in Weeks by Gina Trapani
OMG. Life perspective through UI. I freaking love it. Check out My Life in Weeks by Gina Trapani
via Blog – Brad Frost February 18, 2025Argentinian president Javier Milei promotes memecoin that then crashes 95% in apparent $100 million+ rug pull
A tweet from Argentina's president Javier Milei promoted a memecoin called Libra, which he described as a "private project [that] will [be] dedicated to encouraging the growth of the Argentine economy by funding small Argenti…
via Web3 is Going Just Great February 18, 2025Generated by openring