Felipe Martín

3d-Printing

Adding STL 3D Previews to Forgejo

March 15, 2026

I run a self-hosted Forgejo instance where I keep my repositories, including now some 3D printing projects I have started along with STL files (and SCAD files where applicable). By default Forgejo treats STL files as plain text which means browsing one gives you a wall of ASCII coordinates and makes the page take ages to load. Not ideal.

Codeberg (which runs on Forgejo) had a nice 3D preview for STL files and I wanted the same thing for my instance. It turns out you can achieve this without patching Forgejo itself by combining three things: the markup configuration, custom templates, and a bundled Three.js viewer.

Read more »