Fancy Curl Sites
In a recent development, a "fancy curl version" of a website was created to allow users to view the site in the terminal. Initially, the creator only intended to briefly explain how it was done, but due to inquiries from a few individuals, they decided to write a post detailing the process. The idea for a curl site was inspired by similar projects by trinkey and strongsand, providing all the credit to them for the innovative concept.
To generate the ANSI-marked-up files, the creator entirely hand-wrote the index page and about page. They used a Vim register to easily paste the main escape code, \x1b[1, and referenced the Wikipedia page for the specific graphics codes. The creator experimented with consistent styling and referenced the Gopher version of their pages when crafting the marked-up curl pages.
What makes this version unique is that it offers curl versions of the entire blog, thanks to a coincidence that the creator implemented outputting ANSI-marked-up plaintext in their custom markup language, Gemroff, over four years ago. This feature was trivial to integrate into their static site generator, which already supported multiple, modular output formats.
Presenting the curl version to users required a few changes to their Nginx configuration. An override header (X-Original: true) was added to ensure users still received an unmodified HTTP response. The entire site was still served statically, making the process simple on Nginx servers. The creator encourages others to explore similar tricks for their websites, as it's just a neat gimmick without significant practical use.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.