Skip to content

feat(www): add Markdown negotiation and LLM discovery - #200

Merged
KyleTryon merged 5 commits into
mainfrom
feat/www/markdown-discovery
Sep 20, 2026
Merged

KyleTryon merged 5 commits into
mainfrom
feat/www/markdown-discovery

Conversation

@KyleTryon

@KyleTryon KyleTryon commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Cliparr now serves build-generated Markdown when clients request Accept: text/markdown, while browsers continue receiving HTML. Conversion preserves rendered MDX commands, tables, and callouts without a paid conversion service.

  • Serve direct .md URLs such as /docs.md and /docs/getting-started.md through internal rewrites, with no redirects. The homepage uses /index.md.
  • Point Markdown canonical headers to the corresponding HTML pages; publish alternate links and a contextual llms.txt guide. Keep HTML URLs in the sitemap.
  • Support quality-aware negotiation, HEAD, conditional requests, and representation-safe cache headers.
  • Return a timeline-themed HTML 404 for browsers and a compact Markdown 404 with recovery links for Markdown requests. Both preserve HTTP 404; error pages are noindex and do not advertise canonical or alternate pages.
  • Keep the 404 illustration CSS-only, responsive, and reduced-motion-aware, with keyboard-accessible recovery links and no dependency on JavaScript for recovery.
  • Declare search=yes, ai-input=yes, and ai-train=yes in robots.txt and Markdown content signals.

Preview URL change: nested /…/index.md URLs are replaced by /….md, without compatibility aliases. Generated file locations remain internal.

Page requests, including direct Markdown and arbitrary missing pages, invoke the Worker and count toward Workers usage. Bundled assets, public images/media, scripts, manifests, XML, and text files retain asset-only routing.

Validation: full pnpm preflight and pnpm build:web passed using Node 24. Local Cloudflare checks covered all 24 generated pages, HTML and Markdown negotiation, canonical headers, HEAD, 304 responses, clean 404s, and recovery links. Browser checks covered desktop/mobile layouts, reduced motion, keyboard access, no-JavaScript recovery, and real navigation requests. No production deployment performed.

@KyleTryon
KyleTryon marked this pull request as ready for review September 20, 2026 06:44
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
cliparr-web a5736f2 Commit Preview URL

Branch Preview URL
Sep 20 2026, 03:20 PM

Rewrite public .md requests to generated assets, canonicalize Markdown to HTML, and return format-appropriate errors with recovery links. Add a lightweight accessible timeline illustration for browser 404s.

BREAKING CHANGE: Nested /path/index.md preview URLs are replaced by /path.md without compatibility aliases. The homepage remains /index.md.
@KyleTryon
KyleTryon merged commit 2f1e6af into main Sep 20, 2026
5 checks passed
@KyleTryon
KyleTryon deleted the feat/www/markdown-discovery branch September 20, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant