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