aboutsummaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/notes/making-cgit-look-nicer.md206
1 files changed, 206 insertions, 0 deletions
diff --git a/content/notes/making-cgit-look-nicer.md b/content/notes/making-cgit-look-nicer.md
new file mode 100644
index 0000000..b649b5d
--- /dev/null
+++ b/content/notes/making-cgit-look-nicer.md
@@ -0,0 +1,206 @@
1---
2title: "Making cgit look nicer"
3url: making-cgit-look-nicer.html
4date: 2023-06-24T13:33:58+02:00
5type: notes
6draft: false
7tags: [git]
8---
9
10For personal use I have a private Git server set up and I use GitHub just as a
11mirror. By default the cgit theme looks a bit dated so I made the folowing
12theme.
13
14- `/etc/cgitrc`
15
16```ini
17css=/cgit.css
18logo=/startrek.gif
19favicon=/favicon.png
20source-filter=/usr/lib/cgit/filters/syntax-highlighting-edited.sh
21about-filter=/usr/lib/cgit/filters/about-formatting.sh
22
23local-time=1
24snapshots=tar.gz
25repository-sort=age
26cache-size=1000
27branch-sort=age
28summary-log=200
29max-atom-items=50
30max-repo-count=100
31
32enable-index-owner=0
33enable-follow-links=1
34enable-log-filecount=1
35enable-log-linecount=1
36
37root-title=Place for code, experiments and other bullshit!
38root-desc=
39clone-url=git@git.mitjafelicijan.com:/home/git/$CGIT_REPO_URL
40
41mimetype.gif=image/gif
42mimetype.html=text/html
43mimetype.jpg=image/jpeg
44mimetype.jpeg=image/jpeg
45mimetype.pdf=application/pdf
46mimetype.png=image/png
47mimetype.svg=image/svg+xml
48
49readme=:README.md
50readme=:readme.md
51
52# Must be at the end!
53virtual-root=/
54scan-path=/home/git/
55```
56
57For `syntax-highlighting-edited.sh` follow instructions on
58[https://wiki.archlinux.org/title/Cgit](https://wiki.archlinux.org/title/Cgit#Using_highlight).
59
60- `/usr/share/cgit/cgit.css`
61
62```css
63* {
64 font-size: 11pt;
65}
66
67body {
68 font-family: monospace;
69 background: white;
70 padding: 1em;
71}
72
73th, td {
74 text-align: left;
75}
76
77/* HEADER */
78
79#header {
80 margin-bottom: 1em;
81}
82
83#header .logo img {
84 display: block;
85 height: 3em;
86 margin-right: 10px;
87}
88
89#header .sub.right {
90 display: none;
91}
92
93/* FOOTER */
94
95.footer {
96 margin-top: 2em;
97 font-style: italic;
98}
99
100.footer, .footer a {
101 color: gray;
102}
103
104/* TABS */
105
106.tabs a {
107 margin-bottom: 2em;
108 display: inline-block;
109 margin-right: 1em;
110}
111
112.tabs td a:only-child {
113 display: none;
114}
115
116/* HIDING ELEMENTS */
117
118.cgit-panel, .form {
119 display: none;
120}
121
122/* LISTS */
123
124.list td, .list th {
125 padding-right: 2em;
126}
127
128.list .nohover a {
129 color: black;
130}
131
132.list .button {
133 padding-right: 0.5em;
134}
135
136/* COMMIT */
137
138.commit-subject {
139 padding: 1em 0;
140}
141
142.decoration a {
143 padding-left: 0.5em;
144}
145
146.commit-info th {
147 padding-right: 1em;
148}
149
150.commit-subject {
151 padding: 2em 0;
152}
153
154table.diff div.head {
155 padding-top: 2em;
156}
157
158table.diffstat td {
159 padding-right: 1em;
160}
161
162/* CONTENT */
163
164.linenumbers {
165 padding-right: 0.5em;
166}
167
168.linenumbers a {
169 color: gray;
170}
171
172.pager {
173 display: flex;
174 list-style-type: none;
175 padding: 0;
176 gap: 0.5em;
177}
178
179/* DIFF COLORS */
180
181table.diff {
182 width: 100%;
183}
184
185table.diff td {
186 white-space: pre;
187}
188
189table.diff td div.head {
190 font-weight: bold;
191 margin-top: 1em;
192 color: black;
193}
194
195table.diff td div.hunk {
196 color: #009;
197}
198
199table.diff td div.add {
200 color: green;
201}
202
203table.diff td div.del {
204 color: red;
205}
206```