{
  "description": "Browse aymeric's, an independent, searchable archive of readable snapshots from followed feeds, preserved in Git with aggr.",
  "feed_url": "https://aggr.aymericbeaumet.com/sources/nytpu.com/feed.json",
  "home_page_url": "https://aggr.aymericbeaumet.com/sources/nytpu.com/",
  "items": [
    {
      "authors": [
        {
          "name": "nytpu.com via seb"
        }
      ],
      "content_html": "<h3>March 18, 2026 (Updated: October 14, 2026)</h3>\n<p>So a good while ago I added a fun curl version of my site, meant for viewing in the terminal. Try running these commands!</p>\n<pre><code><span class=\"code-snippet\">curl nytpu.com/gemlog/2026-03-18\n# or\ncurl nytpu.com\n</span></code></pre>\n<p>(sorry Windows users, not my fault that ANSI escape codes are disabled-by-default in <code>cmd.exe</code>. And not my fault that in Powershell you have to use <code>curl.exe</code> instead of <code>curl</code> because Powershell inexplicably aliases that to <code>Invoke-WebRequest</code>.)</p>\n<p>I posted about it a bit on the Fediverse, but otherwise didn't elaborate much on it becuase I figured it was fairly self-explanatory. But I've had a handful of people ask me how I did it, so I decided it might actually be worth it to write a post about how I did it (…like seven months late).</p>\n<p>I should note this idea came from trinkey's (<code>curl trinkey.com</code>) and strongsand's (<code>curl proot.party</code>) curl sites, I didn't come up with it myself. Even though I did go about it quite a bit differently from them, all credit for the very cool idea goes to them. (UPDATE: unfortunately neither of their curl versions are functional anymore as of 2026-10-14.)</p>\n<p>First, since it's the more interesting part, actually generating the ANSI-marked-up files to send to the clients. I entirely hand-wrote the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://git.sr.ht/~nytpu/nytpu.com/tree/master/item/static/curl/index.ansi\">index page</a> and <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://git.sr.ht/~nytpu/nytpu.com/tree/master/item/static/curl/about.ansi\">about page</a>.</p>\n<p>Note that I believe trinkey and strongsand generate theirs on-the-fly with the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/ratatui/ratatui\">ratatui</a> library (or similar), which is probably more convenient; hand-writing it seemed more expedient to me though.</p>\n<p>I had the main escape code—<code>ESC[</code>, i.e. <code>\\x1b[</code>—<sup class=\"footnote-ref\"><a href=\"#fn-1\" id=\"fnref-1\" data-footnote-ref>1</a></sup> in a Vim register to easily paste when needed, and then the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://en.wikipedia.org/wiki/ANSI_escape_code#Select_Graphic_Rendition_parameters\">Wikipedia page for the main graphics codes</a> open to reference the specific escape codes. And, yeah, that's about it. I experimented to decide on consistent styling I liked, and just referenced the Gopher version of my pages when crafting the marked-up curl pages.</p>\n<p>Now, the notable thing about my version is that I have curl versions of the entirety of my blog, rather than just one or two pages being available. This is entirely due to a convenient coincidence: over four years ago I implemented outputting ANSI-marked-up plaintext in my custom markup language I use for my blog, <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://git.sr.ht/~nytpu/gemroff\">Gemroff</a>. Originally it was just to allow convenient previewing of drafts in the terminal while writing; but it was trivial to plug into my static site generator to immediately get Curl versions generated.</p>\n<p>I did manually write a <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://git.sr.ht/~nytpu/nytpu.com/tree/master/item/templates/gemlog-post.ansi\">wrapper template for blog posts</a>, as well as a <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://git.sr.ht/~nytpu/nytpu.com/tree/master/item/templates/gemlog-index.ansi\">template for the index page listing posts</a>, but that plus a few extra lines in my static site generator was all that was needed to wire it up.</p>\n<p>This is the main thing that makes it hard to say it's easy! since it was only easy for me because I use an entirely custom markup language and static site generator and I happened to make the right design choices years ago—e.g. my SSG also happened to already have support for multiple, modular output formats instead of solely HTML like other SSGs, since I tri-host my site on HTTP, Gemini, and Gopher.</p>\n<p>However, offering nothing but a few hand-written pages for fun is a completely acceptable way to set up a site like this anyways, since it's just a neat gimmick and no one's likely to actually use it more than a few minutes of browsing.</p>\n<p>Finally, the last step is actually presenting the Curl version of your site to any user agent containing <code>curl</code>, which for me was just a <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://nytpu.com/gemlog/files/nytpu.com.conf\">few changes to my Nginx config</a>, with other servers it'd presumably be equivalently simple. The main feature I wanted was an override header (<code>X-Original: true</code>) 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.</p>\n<p>And… that's really it! As I said, when I first set it up it seemed fairly self-explanatory to me, but it is very non-orthogonal to what people normally do with either web servers or ANSI escape codes so I can see where people's curiosity/confusion came from. It would be neat to see more sites doing this trick around!</p>\n<section class=\"footnotes\" data-footnotes>\n<ol>\n<li id=\"fn-1\">\n<p>EMDASH! AI-GENERATED! acksually I'll have you know that my markup language has had <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://git.sr.ht/~nytpu/gemroff/tree/999d2f7da1757d756b9780c500f233d0b98e7628/item/doc/elements.md?view-source#L49\">an explicit markup element for emdashes since November 2022</a>. And believe it nor not: LLMs are trained on shit copied from actual authors, so LLMs wouldn't be using emdashes if they weren't already used in human-written works.</p>\n<p>And what, am I supposed to avoid having twenty parentheticals a paragraph, to where I feel the need to use emdashes to vary it up? Unthinkable! <a href=\"#fnref-1\" class=\"footnote-backref\" data-footnote-backref data-footnote-backref-idx=\"1\" aria-label=\"Back to reference 1\">↩</a></p>\n</li>\n</ol>\n</section>\n",
      "date_modified": "2026-10-14T06:24:41+00:00",
      "date_published": "2026-10-14T06:24:41+00:00",
      "external_url": "https://nytpu.com/gemlog/2026-03-18",
      "id": "urn:aggr:item:a1bcbc075d48a5ac5307ad14c1fddd964b752e26",
      "summary": "Comments",
      "tags": [
        "news",
        "web"
      ],
      "title": "Fancy Curl Sites",
      "url": "https://aggr.aymericbeaumet.com/items/lobste-rs/2026-10-14-fancy-curl-sites/"
    }
  ],
  "language": "en",
  "title": "nytpu.com",
  "version": "https://jsonfeed.org/version/1.1"
}