Fancy Curl Sites

Hacker News by 4 min read 28x views
Fancy Curl Sites

Share Post

March 18, 2026 (Updated: October 14, 2026)

So a fine during ago I added a fun curl type of my site, meant for viewing in the terminal. Try operating these commands!

 curl nytpu.com/gemlog/2026-03-18 # or curl nytpu.com 

(sorry Windows users, not my error that ANSI escape codes are disabled-by-default in cmd.exe. And not my error that in Powershell you have to use curl.exe alternatively of curl since Powershell inexplicably pseudonyms that to Invoke-WebRequest.)

I posted concerning it a bit on the Fediverse, but alternatively didn't detailed much on it becuase I figured it was fairly self-explanatory. But I've had a fistful of group ask me how I did it, so I decided it power really be value it to compose a article concerning how I did it (…like seven months late).

I should note this idea came from trinkey's (curl trinkey.com) and strongsand's (curl proot.party) curl sites, I didn't arrive up alongside it myself. Even although I did go concerning it fairly a bit alternatively from them, all credit for the extremely chill idea goes to them. (UPDATE: unfortunately neither of their curl versions are functional anymore as of 2026-10-14.)

First, since it's the additional engaging part, really generating the ANSI-marked-up records to dispatch to the clients. I entirely hand-wrote the index page and about page.

Note that I accept trinkey and strongsand create theirs on-the-fly alongside the ratatui archive (or similar), which is likely additional convenient; hand-writing it seemed additional expedient to me though.

I had the chief escape code—ESC[, ie \x1b[—1 in a Vim enroll to effortlessly paste whenever needed, and afterward the Wikipedia leaf for the chief graphics codes open to citation the particular escape codes. And, yeah, that's concerning it. I experimented to decide on accordant styling I liked, and fair referenced the Gopher type of my pages whenever crafting the marked-up curl pages.

Now, the notable item concerning my type is that I have curl versions of the entirety of my blog, fairly than fair one or two pages being available. This is entirely because of a convenient coincidence: complete four years ago I implemented outputting ANSI-marked-up plaintext in my tradition markup tongue I use for my blog, Gemroff. Originally it was fair to authorize convenient previewing of drafts in the terminal during writing; but it was trivial to plug into my fixed location generator to immediately get Curl versions generated.

I did manually compose a wrapper template for blog posts, as fine as a template for the indicator leaf listing posts, but that affirmative a few additional lines in my fixed location generator was all that was needed to cable it up.

This is the chief item that makes it difficult to say it's easy! since it was lone uncomplicated for me since I use an entirely tradition markup tongue and fixed location generator and I happened to create the correct scheme choices years ago—e.g. my SSG additionally happened to already have assistance for multiple, standardized output formats alternatively of solely HTML akin another SSGs, since I tri-host my location on HTTP, Gemini, and Gopher.

However, offering nothing but a few hand-written pages for fun is a entirely satisfactory way to set up a location akin this anyways, since it's fair a neat gimmick and no one's apt to really use it additional than a few minutes of browsing.

Finally, the final stage is really presenting the Curl type of your location to any person delegate containing curl, which for me was fair a few changes to my Nginx config, alongside another servers it'd presumably be equivalently simple. The chief characteristic I wanted was an override header (X-Original: true) so you could motionless get an unmodified HTTP reply akin person casually operating Curl apt wanted, and I wanted everything to be served statically still.

And… that's really it! As I said, whenever I archetypal set it up it seemed fairly self-explanatory to me, but it is extremely non-orthogonal to what group normally do alongside either web servers or ANSI escape codes so I can see anywhere people's curiosity/confusion came from. It would be neat to see additional sites doing this trick around!


  1. EMDASH! AI-GENERATED! acksually I'll have you cognize that my markup tongue has had an definitive markup component for emdashes since November 2022. And accept it nor not: LLMs are trained on crap copied from genuine authors, so LLMs wouldn't be using emdashes if they weren't already used in human-written works.

    And what, am I expected to evade having twenty parentheticals a paragraph, to anywhere I awareness the need to use emdashes to change it up? Unthinkable! ↩︎

Other Article Hacker News
↑
Close Right Ads
Close Left Ads