summaryrefslogtreecommitdiffstats
path: root/CLAUDE.md
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-05-07 20:28:07 +0200
committerDanilo M. <danix@danix.xyz>2026-05-07 20:28:07 +0200
commitfb4dc0ca40de143ac92f73936b60d7679c8337f7 (patch)
tree354edbbd1748e1656eb142a6a202247c99e817c7 /CLAUDE.md
downloadcgit-theme-danix-fb4dc0ca40de143ac92f73936b60d7679c8337f7.tar.gz
cgit-theme-danix-fb4dc0ca40de143ac92f73936b60d7679c8337f7.zip
Initial commit: cgit theme for danix.xyz
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'CLAUDE.md')
-rw-r--r--CLAUDE.md70
1 files changed, 70 insertions, 0 deletions
diff --git a/CLAUDE.md b/CLAUDE.md
new file mode 100644
index 0000000..3f6a636
--- /dev/null
+++ b/CLAUDE.md
@@ -0,0 +1,70 @@
+# CLAUDE.md
+
+This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
+
+## What This Is
+
+A custom cgit theme for git.danix.xyz. cgit is a static-feeling git web frontend written in C that generates HTML server-side. This repo contains the theme files only — no build step, no package manager.
+
+## Files
+
+- `cgit.css` — main stylesheet; covers all cgit page types
+- `head.html` — injected into cgit's `<head>`: font imports + CSS link
+- `footer.html` — injected as cgit's footer
+- `syntax-highlight.py` — cgit `source-filter` script; Pygments-based, must stay executable (`chmod +x`)
+- `images/lampD.png` — logo (sourced from `../danix.xyz-hacker-theme/static/images/`)
+- `cgitrc.example` — deployment reference; not used at runtime
+
+## Design System
+
+Colors, fonts, and token colors are derived from `../danix2-hugo-theme/assets/css/main.css` and `../danix2-hugo-theme/assets/css/chroma-custom.css`. Do not introduce colors or fonts that aren't in those files.
+
+| Role | Value |
+|------|-------|
+| `--bg` | `#060b10` |
+| `--accent` | `#a855f7` |
+| `--accent2` | `#00ff88` |
+| `--text` | `#c4d6e8` |
+| Headings | Oxanium |
+| Prose | IBM Plex Sans |
+| Code/hashes/filenames | JetBrains Mono |
+| Syntax tokens | Catppuccin Macchiato |
+
+## cgit HTML Selectors (critical)
+
+cgit generates fixed HTML. Key selectors used in `cgit.css`:
+
+| Element | Selector |
+|---------|----------|
+| Outer wrapper | `div#cgit` |
+| Header table | `table#header` |
+| Logo cell | `td.logo` |
+| Site name cell | `td.main` |
+| Nav tabs | `table.tabs` |
+| Breadcrumb | `div.path` |
+| Main content | `div.content` |
+| All list tables | `table.list` |
+| Section header rows | `tr.nohover-highlight td.reposection` |
+| Repo name cells | `td.toplevel-repo`, `td.sublevel-repo` |
+| Diff table | `table.diff` |
+| Diff added rows | `tr.add` / `td.add` |
+| Diff removed rows | `tr.del` / `td.del` |
+| Hunk headers | `div.hunk` |
+| Blob table | `table.blob` |
+| Line number cell | `td.linenumbers` |
+| Code cell | `td.lines` |
+| Footer | `div.footer` |
+
+If cgit's generated markup ever differs (version-dependent), inspect the live HTML first before changing selectors.
+
+## Syntax Highlighting
+
+`syntax-highlight.py` is a cgit `source-filter`. cgit calls it as:
+```
+syntax-highlight.py <filename>
+```
+File content arrives on stdin; highlighted HTML goes to stdout. Requires `pygments` installed on the server (`pip install pygments`). Token CSS classes (`.highlight .k`, `.highlight .s`, etc.) are styled in `cgit.css` using Catppuccin Macchiato colors — do not switch to inline styles.
+
+## Deployment
+
+Theme files are served statically at `/cgit-theme/`. The cgit process reads them from disk (filesystem paths in `cgitrc`). See `cgitrc.example` for the full wiring. Repo categories come from `section=` directives in `cgitrc` — the CSS renders them as `# category` headings via `td.reposection::before`.