A developer describes how they built a curl-friendly version of their personal website, designed to be viewed in the terminal. Running commands like curl nytpu.com returns ANSI-colored text instead of standard HTML. The author notes that Windows users may see raw escape codes, since ANSI support is disabled by default in cmd.exe, and that PowerShell aliases curl to Invoke-WebRequest unless curl.exe is used.
The idea came from curl sites built by trinkey and strongsand, which the author credits as the inspiration. The author hand-wrote the index and about pages using the ESC escape character and referenced Wikipedia's list of graphics codes for styling. The full blog, however, was made possible by a custom markup language called Gemroff, which already outputs ANSI-marked-up plaintext for previewing drafts in the terminal. Plugging that output into the static site generator produced curl versions of every post with only a few extra lines of configuration.
The final step was an Nginx configuration change that serves the curl version to any user agent containing curl. An X-Original: true header lets users request the unmodified HTTP response. The author stresses that the setup is easy only because of earlier design choices, such as a static site generator that supports multiple output formats. The author hopes more sites will experiment with the technique.
Source: Hacker News · Summarized by HeadlinesBriefing