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