AI Resource Pro / website · airesourcepro.com / src / app / llms.txt / route.ts
| 1 | // llms.txt (https://llmstxt.org): a plain-text map of the site for AI assistants and AI search tools |
| 2 | import { AUTHOR, SITE_DESCRIPTION, SITE_NAME, SITE_URL } from "@/lib/seo"; |
| 3 | import { TRACKS } from "@/lib/tracks"; |
| 4 | import { getPublishedTutorials } from "@/lib/tutorials"; |
| 5 | |
| 6 | export const dynamic = "force-static"; |
| 7 | |
| 8 | export function GET() { |
| 9 | const tutorials = getPublishedTutorials(); |
| 10 | const sections = TRACKS.map((track) => { |
| 11 | const list = tutorials.filter((t) => t.track === track.slug); |
| 12 | const lines = list.map((t) => `- [${t.title}](${SITE_URL}/${t.track}/${t.slug}): ${t.description}`); |
| 13 | return [`## ${track.name}`, "", `${track.tagline}. [All ${track.name} tutorials](${SITE_URL}/${track.slug})`, "", ...lines].join("\n"); |
| 14 | }); |
| 15 | |
| 16 | const text = [ |
| 17 | `# ${SITE_NAME}`, |
| 18 | "", |
| 19 | `> ${SITE_DESCRIPTION}`, |
| 20 | "", |
| 21 | `Free, hands-on AI tutorials written by the ${AUTHOR.name} team (${SITE_URL}${AUTHOR.path}).`, |
| 22 | "", |
| 23 | "The Claude and Codex best-practice pages collect Anthropic's and OpenAI's own documentation, guides and videos, with credit and links to the originals.", |
| 24 | "", |
| 25 | ...sections.flatMap((section) => [section, ""]), |
| 26 | "## Optional", |
| 27 | "", |
| 28 | `- [All tutorials](${SITE_URL}/tutorials): every tutorial, filterable by track and level`, |
| 29 | `- [About](${SITE_URL}/about): what the site is`, |
| 30 | `- [RSS feed](${SITE_URL}/feed.xml): new tutorials as they're published`, |
| 31 | `- [Videos](${SITE_URL}/videos): the video tutorials`, |
| 32 | "", |
| 33 | ].join("\n"); |
| 34 | |
| 35 | return new Response(text, { headers: { "Content-Type": "text/plain; charset=utf-8" } }); |
| 36 | } |