Cybrkyd's git repositories

GitGen

Branch: main Last commit: 2026-01-19 15:39:56 +0000 Clone: git clone https://git.cybrkyd.com/repository/GitGen

GitGen

GitGen is a lightweight static website generator for local Git repositories written in Python. It scans a directory of Git repositories and produces a navigable, self-contained HTML website similar in spirit to cgit or GitWeb, but without any server-side dependencies.

The generated site includes a repository index, per-repository README rendering, file listings, commit history, and detailed commit views with diffs.

Features

GitGen generates a static HTML site with the following capabilities:

All output is static HTML and CSS, suitable for hosting on any static web server.

Requirements

Python dependencies:

Requires markdown.

Install with:

pip install markdown

Usage

  1. Place the script somewhere on your system.
  2. Edit the default base path to repositories:
GitRepoScanner:
def __init__(self, base_path: str = "/path/to/Git/repositories")
  1. Run the script:
python3 gitgen.py
  1. The generated site will be written to the git-website/ directory by default.

Open git-website/index.html in a browser or deploy the directory contents to a static web host.

Directory Structure

The generated output has the following structure:

git-website/
├── index.html
├── main.css              # main.css is not generated*
├── repo-name/
│   ├── index.html        # README / overview
│   ├── files.html        # File listing
│   ├── commits.html      # Commit list
│   └── commits/
│       └── abc1234.html  # Individual commit pages

Each repository gets its own directory containing all related pages.

* main.css is not generated but included in this repo. Add it manually to the git-website directory.

README Rendering

GitGen looks for README files in the following order:

Markdown READMEs are rendered using Python-Markdown with these extensions enabled:

Non-Markdown READMEs are rendered as escaped pre-formatted text.

Licence

This project is made available under a GPL3 licence -- see COPYING for the full text.