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.

Render images and 3D models in the browser views

3b2bcc30534f24b4628b6365e69dcb9065115065 · Keenan Nemetz · 13d ago · parent 87bab8e1

Render images and 3D models in the browser views

A blob whose name is an image is served as that image, so the <img> a README
already emitted works and the source view can show it. An SVG keeps its source
view and previews on request. The instance introduction resolves assets/, so a
landing-page picture is no longer a broken link.

A changed image or model shows both sides in the commit, compare, and change
request diffs, where git only says "binary". The 3D viewer is a vendored
three.js bundle, loaded only when a page has a model, with a download fallback
for a reader without JavaScript or WebGL.

closes: 01M7XQ9AKKKFNEX0F679JRRYQD

internal/lang/lang.go +4

@@ -51,6 +51,8 @@ func For(name string) string {
51 51 return "HTML"
52 52 case ".css", ".scss", ".sass":
53 53 return "CSS"
54 case ".stl", ".obj", ".gltf", ".glb", ".3mf":
55 return "3D model"
54 56 case ".json":
55 57 return "JSON"
56 58 case ".yml", ".yaml":
@@ -107,6 +109,8 @@ func Class(name string) string {
107 109 return "lang-html"
108 110 case ".css", ".scss", ".sass":
109 111 return "lang-css"
112 case ".stl", ".obj", ".gltf", ".glb", ".3mf":
113 return "lang-model"
110 114 case ".json", ".yaml", ".yml", ".toml", ".ini", ".xml", ".conf":
111 115 return "lang-config"
112 116 case ".md", ".markdown", ".mdown", ".mkd", ".txt", ".rst":