blob: 63879d6a3accbd0e4b4c29a090fe0d987838ac60 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# 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` |
| About/README content | `div#summary` |
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`.
|