Skip to content

Add llms.txt route handlers to Next.js website#905

Open
SakshiKekre wants to merge 1 commit intomainfrom
feat/llms-txt-route-handler
Open

Add llms.txt route handlers to Next.js website#905
SakshiKekre wants to merge 1 commit intomainfrom
feat/llms-txt-route-handler

Conversation

@SakshiKekre
Copy link
Copy Markdown
Collaborator

Summary

  • Ports llms.txt generation from Vite build script (app/scripts/generate-llms-txt.ts) to Next.js route handlers
  • Restores /llms.txt, /llms-full.txt, /llms-recent.txt, /llms-research-us.txt, /llms-research-uk.txt which have been 404ing since the website domain cutover to Next.js
  • Core transformation logic (Plotly chart → text summaries, iframe → placeholders, notebook text extraction) copied from Vite script with minimal changes to use existing website modules (getPostsSorted, getArticleContent, authors.json)
  • Fixes broken /us/api-explorer link in the index (was 404, now /us/api)

Verified

  • All 5 routes return 200 with Content-Type: text/plain
  • Article counts match old script exactly: 190 full, 50 recent, 108 US, 73 UK
  • Typecheck and build pass

Test plan

  • Verify /llms.txt returns the index on Vercel preview
  • Verify /llms-full.txt returns all 190 articles
  • Verify /llms-research-us.txt and /llms-research-uk.txt return region-filtered articles
  • Verify /llms-recent.txt returns 50 most recent articles

Port llms.txt generation from Vite build script (app/scripts/generate-llms-txt.ts)
to Next.js route handlers. Restores /llms.txt, /llms-full.txt, /llms-recent.txt,
/llms-research-us.txt, /llms-research-uk.txt which have been 404ing since the
website domain cutover to Next.js.

Core transformation logic (chart summaries, iframe placeholders, notebook extraction)
copied from the Vite script with minimal changes to use existing website modules
(getPostsSorted, getArticleContent, authors.json import) instead of standalone
fs/path scaffolding.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policyengine-app-v2 Ready Ready Preview, Comment Apr 2, 2026 5:14am
policyengine-calculator Ready Ready Preview, Comment Apr 2, 2026 5:14am
policyengine-website Ready Ready Preview, Comment Apr 2, 2026 5:14am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
policyengine-calculator-next Skipped Skipped Apr 2, 2026 5:14am

Request Review

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