logoalt Hacker News

vidarhtoday at 10:18 AM3 repliesview on HN

Every page on code.claude.com has a markdown version available by just appending ".md", and Claude Code knows about it. E.g:

https://code.claude.com/docs/en/overview and

https://code.claude.com/docs/en/overview.md


Replies

9devtoday at 10:54 AM

After some consideration, I also applied this convention to every site I build - including content negotiation: Clients can either send an Accept header with their preference, or append an explicit extension (.md|.markdown for Markdown, .json for JSON API responses, or .html for the human HTML page). Together with the content negotiation part, it feels very much like HTTP was intended to work - especially the fact that API clients, AI agents, and humans all use the same URLs, but get the content in the shape they need.

show 1 reply
mceachentoday at 3:38 PM

Here's how to do it with more recent versions of Hugo:

https://photostructure.com/coding/hugo-markdown-output/

(It includes the grandparent's head link suggestion, but it's not just "change .html to .md" because I'm old skool and as a wee nerd was told that URLs ending in .html or .php or whatever we're frowned on, so the above link's markdown is available by appending /index.md )