Fancy Curl Sites

49 points by seb


JulianSildenLanglo

Finally, the last step is actually presenting the Curl version of your site to any user agent containing curl, which for me was just a few changes to my Nginx config, with other servers it'd presumably be equivalently simple. The main feature I wanted was an override header (X-Original: true) so you could still get an unmodified HTTP response like someone casually running Curl likely wanted, and I wanted everything to be served statically still.

Isn't this what the Accept-header is meant for? I.e. curl nytpu.com/gemlog/2026-03-18 -H "Accept: text/html".

vbernat

Nice idea. The two other referenced sites mentioned in the post returns HTML when queried by Curl.

tinthedev

I've skipped the show. curl tinthe.dev is HTML, don't see why to mess with the default. Seems like a super rare use-case. Are there people who curl sites?

Although, I did put in <link rel="alternate" type="text/markdown" href="/home.md" title="..."> as a hint for using Accept: text/markdown on the same URL. Or going to .md versions of pages. Did it a "sprint" of optimizing for other devices, screen readers, and LLMs. It is supported on the full page, posts included. Same point as the draft preview, less color.

Not sure if the X-Original header is the bit to use though. How many users will be comfy with cURL and headers, while not being comfortable using something like Accept: text/html (which is the defacto standard). Poking at the implementation, seems like you ignore Accept headers entirely.

Now I'm tempted to drop an invisible "instructions" block on top of curl, instructing for this alternate approach. But we're approaching diminishing returns there, hah.