Introducing snippethost.gitlab.io

2026-01-11
Posts | 1 min read
#gitlab #javascript

It is no secret that I’m no big fan of GitHub and it’s dominance in the VCS-ecosystem.

So in an effort of leveling the playing field I’m taking it onto myself to build more cool things for and with my VCS of choice, GitLab!

Recently I came across a post by Simon Willison about his efforts to revitalize gistpreview into gisthost.

I vaguely remember stumbling across this project years ago and judging it quite useful. Explained shortly it let’s you see a rendered version of an HTML page that you saved to a Gist.

So this time around I took it onto myself to fork Simons latest version and adapt it for GitLab Snippets.

It is available at snippethost.gitlab.io and the source is over on GitLab.

You can see it in action at these URLs:

The whole project is a straight forward single index.html, which Simon did a great job modernizing and explaing in his post.

My changes are only a slight adaptation, using the GitLab v4 API to get the snippet and it’s content, made slightly more complicated because GitLab unfortunately does not set a Access-Control-Allow-Origin: * on raw snippet URLs.

Additionally I’ve added the minimal code required to deploy everything to GitLab pages.