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