Cybrkyd's git repositories

GitGen • commit: 31def1b

commit 31def1bf7e6c475ac8f18f02d96cac68bab31e7189e985cddb7926962835071b
author cybrkyd <noreply@cybrkyd.com> 2026-01-14 18:52:15 +0000
committer cybrkyd <noreply@cybrkyd.com> 2026-01-14 18:52:15 +0000

Commit Message

- More README wording
- Commit history level to 50 (from 25)
- Padding for rendered README

📊 Diffstat

README.md 39
gitgen.py 5
main.css 2
3 files changed, 40 insertions(+), 6 deletions(-)

Diff

diff --git a/README.md b/README.md
index 7942217..d4a0d42 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,43 @@
# Gitgen
- GitGen is a static git repository website generator written in Python.
+ 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.
- It scans a directory of local Git repositories, extracts metadata and history using standard Git commands, and outputs a fully static website composed of plain HTML and CSS.
+ 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:
+
+ - Repository index page listing all discovered Git repositories
+ - Automatic discovery of Git repositories under a base directory
+ - Repository overview pages with rendered README files
+ - File tree listings based on the current `HEAD`
+ - Commit history (last 50 commits per repository)
+ - Detailed commit pages with:
+ - Full commit metadata
+ - Tags pointing at relevant commits
+ - Diffstat summary
+ - Unified diff view (truncated for very large diffs)
+ - Markdown rendering for README files
+ - Safe HTML escaping throughout
+ - Parallel repository processing for faster generation
+
+ All output is static HTML and CSS, suitable for hosting on any static web server.
+
+ ## Requirements
+
+ - Python 3.8 or newer
+ - Git installed and available in `$PATH`
+
+ **Python dependencies**:
+
+ Requires `markdown`.
+
+ Install with:
+
+ ```
+ pip install markdown
+ ```
## Licence
diff --git a/gitgen.py b/gitgen.py
index a196cee..e0b3f25 100644
--- a/gitgen.py
+++ b/gitgen.py
@@ -163,7 +163,7 @@ class GitRepoScanner:
return self.commit_history_cache[repo_path]
log = self.run_git_command(repo_path, [
- 'log', '--max-count=25',
+ 'log', '--max-count=50',
'--pretty=format:%H|%an|%ae|%ad|%s|%P',
'--date=iso'
])
@@ -256,7 +256,6 @@ class HTMLGenerator:
def generate_index(self, repos: List[Dict]) -> str:
"""Generate main index page"""
-
current_time = datetime.datetime.now(datetime.timezone.utc)
time_str = current_time.strftime('%Y-%m-%d %H:%M:%S %z')
@@ -697,7 +696,7 @@ def process_repo(repo, scanner, output_dir):
HTMLGenerator(scanner).generate_commits_page(repo, commits), encoding='utf-8'
)
- for commit in commits[:25]:
+ for commit in commits[:50]:
html_page = HTMLGenerator(scanner).generate_commit_detail_page(repo, commit)
(commits_dir / f"{commit['short_hash']}.html").write_text(
html_page, encoding='utf-8'
diff --git a/main.css b/main.css
index 6268623..b893d81 100644
--- a/main.css
+++ b/main.css
@@ -91,7 +91,7 @@ body {
.readme-content {
background: white;
- padding: 2rem;
+ padding: 2rem 4rem;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
margin-bottom: 2rem;