| 1 | import { fileAsMarkdown } from '../lib/content'; |
| 2 | import { absolutizeRelativeLinks } from '../lib/utils'; |
| 3 | |
| 4 | /** |
| 5 | * llms-full.txt, the entire docs content as one plain-text blob, for |
| 6 | * LLM-aware clients that prefer a single fetch over walking individual |
| 7 | * page URLs. Mirrors /docs.md, served under the llms.txt-adjacent |
| 8 | * conventional path. |
| 9 | * |
| 10 | * @type {import('astro').APIRoute} |
| 11 | */ |
| 12 | export const GET = async ({ site }) => { |
| 13 | const origin = site?.origin || 'https://htmx.org'; |
| 14 | const content = absolutizeRelativeLinks(fileAsMarkdown('docs.mdx'), origin); |
| 15 | return new Response(content, { |
| 16 | headers: { |
| 17 | 'Content-Type': 'text/plain; charset=utf-8', |
| 18 | 'Cache-Control': 'public, max-age=3600', |
| 19 | }, |
| 20 | }); |
| 21 | }; |