Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Blame · docs/customization.md

Line attribution on main · 281 line(s)

d1f44d83
Keenan Nemetz
21h ago
1 # Customization
2
3 ## Customizing the instance
4
5 The instance customization repository supplies the landing-page introduction,
6 styles, favicon, and static assets. `vole admin init` creates the default private
7 repository; an instance admin can also scaffold it from **Admin →
8 Configuration**.
9
10 ### 1. Name the instance and repository
11
12 Set these values in `vole.toml` and restart Vole:
13
14 ```toml
15 instance_name = "Acme Forge"
16 instance_repo = "vole-instance"
17 ```
18
19 `instance_name` changes the landing-page heading and document titles. Set
20 `instance_repo = ""` to disable repository-provided customization.
21
22 ### 2. Clone the customization repository
23
24 ```sh
25 git clone ssh://git@forge.example.com:2222/vole-instance.git
26 cd vole-instance
27 ```
28
29 If the system sshd listens on port 22, omit `:2222`. You need instance-admin
30 access to read the private customization repository.
31
32 ### 3. Edit the introduction and styles
33
34 Write `profile/README.md` with the landing-page introduction:
35
36 ```markdown
37 # Acme Forge
38
39 Source, reviews, CI, and releases for the Acme team.
40 ```
41
42 Create `profile/custom.css` to override design tokens:
43
44 ```css
45 :root[data-theme] {
46 --accent: #c678dd;
47 --radius: 4px;
48 }
49 ```
50
51 Commit and push the changes:
52
53 ```sh
54 git add profile/README.md profile/custom.css
55 git commit -m "Customize the landing page"
56 git push origin main
57 ```
58
59 Vole reloads the snapshot within a few seconds and keeps the previous snapshot
60 if loading fails. See [Customization paths](#customization-paths) for every
61 supported file, and [Theming](#theming) and [Design tokens](#design-tokens) for
62 theme syntax and security boundaries.
63
64 ## Customization files
348a43c3
Keenan Nemetz
20d ago
65
66 The repository named by `instance_repo` supplies the instance introduction,
67 styles, favicon, and static assets. It is an ordinary private repository by
68 default; visitors can receive its designated public files without receiving
d1f44d83
Keenan Nemetz
21h ago
69 repository access.
348a43c3
Keenan Nemetz
20d ago
70
d1f44d83
Keenan Nemetz
21h ago
71 ### Customization paths
348a43c3
Keenan Nemetz
20d ago
72
73 | Path | What it does |
74 |---|---|
75 | `profile/README.md` | Sanitized Markdown introduction above the repository list |
76 | `profile/private/README.md` | Replaces the introduction for signed-in viewers |
77 | `profile/custom.css` | Styles loaded after built-in and selected theme styles |
78 | `profile/themes/<id>.css` | One self-describing selectable theme per file |
79 | `profile/favicon.svg` | Replaces the favicon links |
80 | `assets/` | Files served at `/-/static/custom/assets/` |
81
82 Other files are ignored. Assets are limited to CSS, images, and fonts;
83 same-origin scripts are not accepted as customization. Push changes to publish
84 them. Vole reloads the snapshot within a few seconds and keeps the previous
85 snapshot when loading fails. An empty `profile/README.md` removes the
86 introduction body.
87
88 `instance_name` controls the landing-page heading, document titles, and brand
89 link's accessible name. It does not rename the Vole software or replace its
90 brand mark.
91
3b2bcc30
Keenan Nemetz
13d ago
92 ### Images in the introduction
93
94 A relative destination in the introduction is a path in the customization
95 repository. Only a destination under `assets/` becomes a link, because that is
96 the namespace the instance serves as files. Point at a picture by its path
97 there: `assets/logo.png`, or `../assets/light/logo.png` from
98 `profile/README.md`.
99
100 An `assets/` destination becomes `/-/static/custom/assets/...`; a relative link
101 to anything else, and an absolute or external URL, stays as written. The public
102 and private introductions resolve the same way, so one image serves both readers.
103
d1f44d83
Keenan Nemetz
21h ago
104 ### Theming
348a43c3
Keenan Nemetz
20d ago
105
106 `profile/custom.css` loads after `vole.css`, `everforest.css`, `palettes.css`,
107 and the selected theme pack. Override design tokens instead of copying component
108 rules so layout, contrast, and responsive behavior remain intact.
109
110 The Appearance picker includes built-in Everforest variants, Catppuccin Mocha
111 and Latte, Nord, Solarized Light, Rosé Pine Moon and Dawn, Kanagawa Wave,
112 Dracula, Tokyo Night, and Ayu Light, followed by instance theme packs.
113
114 ### Theme packs
115
116 Each file under `profile/themes/` defines one theme. Its file name supplies both
117 the id and a human-readable label: `acme-ocean.css` becomes **Acme Ocean**.
118
119 ```css
120 /* profile/themes/acme-ocean.css */
121 :root[data-theme="acme-ocean"] {
122 color-scheme: dark;
123 --bg: #0b1720;
124 --bg-panel: #102433;
125 --bg-raised: #163041;
126 --fg: #d7e8f0;
127 --fg-muted: #8fb0c0;
128 --fg-faint: #6f8f9f;
129 --accent: #38bdf8;
130 --accent-fg: #04121a;
131 --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
132 }
133 ```
134
135 A light theme must set `color-scheme: light` and light surface and text tokens:
136
137 ```css
138 /* profile/themes/acme-paper.css */
139 :root[data-theme="acme-paper"] {
140 color-scheme: light;
141 --bg: #fffdf7;
142 --bg-panel: #f8f3e8;
143 --bg-raised: #f1eadc;
144 --fg: #2b2a26;
145 --fg-muted: #6b675d;
146 --fg-faint: #8d887c;
147 --accent: #9a5b13;
148 --accent-fg: #fffdf7;
149 --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
150 }
151 ```
152
153 Theme ids use lowercase letters, digits, and dashes and are at most 41
154 characters. They cannot collide with `system`, `nord`, `dracula`, `tokyo-night`,
155 or names beginning with `everforest-`, `catppuccin-`, `solarized-`, `rose-pine-`,
156 `kanagawa-`, or `ayu-`. An invalid file fails snapshot loading and leaves the
157 previous theme active.
158
159 Every theme file is linked on every page, so keep theme packs small. A reader's
160 selection lives in browser `localStorage`, not in the account database. Deleting
161 a selected theme returns that browser to System.
162
163 ### Design tokens
164
165 Scope overrides to `:root[data-theme]`, not plain `:root`. Built-in selectors
166 such as `:root[data-theme^="everforest-"]` are more specific than `:root` and
167 would otherwise win.
168
169 ```css
170 :root[data-theme] {
171 --accent: #c678dd;
172 --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
173 --radius: 4px;
174 --radius-lg: 6px;
175 --page-max: 1200px;
176 }
177 ```
178
179 Use these selectors when a value differs between Everforest dark and light
180 variants:
181
182 ```css
183 :root[data-theme^="everforest-dark"] { --bg: #101418; }
184 :root[data-theme^="everforest-light"] { --bg: #fffdf7; }
185 ```
186
187 | Group | Tokens |
188 |---|---|
189 | Surfaces | `--bg`, `--bg-panel`, `--bg-raised`, `--bg-hover`, `--bg-active`, `--border`, `--border-strong` |
190 | Text | `--fg`, `--fg-muted`, `--fg-faint` |
191 | Identity | `--accent`, `--accent-fg`, `--accent-soft` |
192 | Status | `--good`, `--good-soft`, `--bad`, `--bad-soft`, `--warn`, `--warn-soft`, `--running`, `--merged`, `--merged-soft`, `--status-fg` |
193 | Shape | `--radius`, `--radius-lg`, `--page-max`, `--page-gutter`, `--search-w` |
194 | Type | `--font`, `--mono`, `--fs`, `--lh`; leave `--font-scale` to the reader's text-size preference |
195 | Syntax | `--syn-comment`, `--syn-punctuation`, `--syn-operator`, `--syn-number`, `--syn-string`, `--syn-keyword`, `--syn-function`, `--syn-type`, `--syn-variable`, `--syn-added`, `--syn-deleted` |
196
197 When tokens are insufficient, page-level classes include `.panel`, `.readme`,
198 `.md`, `.repo-card`, `.repo-grid`, `.home-grid`, `.home-rail`, `.repohead`,
199 `.tabs`, `.chip`, `.label`, `.status`, `.config-table`, `.diff`, and `.blob`.
200 These classes are not a stable public API; prefer tokens because upgrades can
201 change markup.
d1f44d83
Keenan Nemetz
21h ago
202
203 ## Media previews
204
205 Preview images and 3D models in the code browser, a commit or compare diff, and
206 the Files tab of a change request. Markdown files use the same support.
207
208 No configuration is required. A format with no useful source view, such as a PNG
209 or binary STL, appears in place of the source table. A text format that is also a
210 model or image, such as SVG, OBJ, ASCII STL, or glTF, keeps its source view and
211 gains a **Preview** toggle.
212
213 ### Images
214
215 | Extensions | Served as |
216 |---|---|
217 | `.png` | `image/png` |
218 | `.jpg` `.jpeg` | `image/jpeg` |
219 | `.gif` | `image/gif` |
220 | `.webp` | `image/webp` |
221 | `.avif` | `image/avif` |
222 | `.bmp` | `image/bmp` |
223 | `.ico` | `image/x-icon` |
224 | `.svg` | `image/svg+xml` |
225
226 Raw bytes are served with the image's type, so an `<img>` works. Every other
227 extension stays `text/plain` and the response is `nosniff`, so an HTML file in a
228 repository is never rendered on the forge's origin. An SVG opened directly is
229 made inert by a Content-Security-Policy; as an image it renders normally.
230
231 In a Markdown document, an image path is resolved against the document, not the
232 page it is rendered on. A README beside `images/board.png` names that path. The
233 instance introduction resolves `assets/...` to the customization assets; see
234 [Images in the introduction](#images-in-the-introduction).
235
236 An image larger than 32 MiB is a download rather than an inline preview.
237
238 ### 3D models
239
240 | Extension | Format |
241 |---|---|
242 | `.stl` | STL, binary or ASCII |
243 | `.obj` | Wavefront OBJ geometry |
244 | `.gltf` | glTF (JSON) |
245 | `.glb` | glTF (binary) |
246 | `.3mf` | 3D Manufacturing Format |
247
248 The viewer runs in the browser and needs only the file. Drag to turn the model
249 like a turntable: sideways spins it about its own up axis, up and down tips it
250 over the top, and the two mix without rolling it. Scroll, pinch, or use the + and
251 − buttons to zoom; Front, Top and Right put a known side toward you; the
252 remaining buttons reset the view and toggle a wireframe. On a diff the before
253 and after models turn and zoom together, and Sync turns that link off for a
254 reader who wants each side at its own angle and zoom. It is loaded on demand, so
255 a page without a model downloads none of it. Without JavaScript or WebGL, the
256 file's download link stays visible.
257
258 A Markdown document names a model the same way it names a picture: a relative
259 image path whose extension is on the list above. A README can therefore show an
260 assembly beside the prose. The image's alt text labels the preview, and the
261 file's name is what the fallback offers to download. A path in a document that
262 has no place in a tree — an issue body, the instance introduction — stays an
263 image, because there is no raw route behind it for the viewer to fetch.
264
265 A `.gltf` may name buffers and textures beside it; they are fetched through the
266 same raw path. A companion `.mtl` for an `.obj` is not loaded, so an OBJ arrives
267 as geometry with a plain material.
268
269 Compressed glTF assets are not supported. A model that uses Draco, KTX2, or
270 meshopt reports that it could not be loaded and keeps its download link.
271
272 A model larger than 64 MiB is a download rather than an inline preview in the
273 code browser, which reads the file's size before rendering. A Markdown document
274 is rendered from its text alone, so the path is all that decides there: a
275 README's model is offered to the viewer whatever its size.
276
277 ## Next
278
279 - [Configuration](configuration.md) — settings, listeners, and HTTPS.
280 - [Workflows](workflows.md#run-artifacts) — build and publish artifacts.
281 - [Releases](releases.md) — attach downloads rather than preview them.