Skip to content

Serve public site content as Markdown for AI agents - #192

Merged
s3rot0n1n merged 1 commit into
mainfrom
t3/issue-27
Nov 5, 2026
Merged

s3rot0n1n merged 1 commit into
mainfrom
t3/issue-27

Conversation

@s3rot0n1n

@s3rot0n1n s3rot0n1n commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes #27

Summary

  • Add Markdown responses for public pages through .md URLs and Accept: text/markdown negotiation, plus Markdown 404 responses.
  • Generate /llms.txt with site instructions and links to public content; exclude hidden sites and deduplicate paths.
  • Support agentInstructions in site settings and Git import/export, and include page titles in sitemap data.
  • Add Markdown rendering, negotiation, proxy and cache coverage; document the new behavior.

Testing

  • Sites tests: 82 passed.
  • Page builder tests: 63 passed.
  • Typechecks passed for sites, page builder and API.
  • Biome checks passed for changed files.
  • Browser smoke covered .md URLs, Accept negotiation, /llms.txt, Markdown 404s and normal HTML navigation.

- Add Markdown page routes, `.md` URLs, and `/llms.txt`
- Include agent instructions in site configuration and Git sync
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T15:34:42.007733Z 4151093 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4151093ab5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (match) {
const viaUrl = new URL(request.url).searchParams.get("md") === "url";
const location =
viaUrl && match.to.startsWith("/") ? markdownUrl(match.to) : match.to;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve query strings when redirecting Markdown URLs

When a site.json redirect target contains a query string, markdownUrl(match.to) appends .md to the whole string (/new?lang=en becomes /new?lang=en.md). The redirected URL no longer has a .md pathname, so the destination is served as HTML instead of Markdown. Add the suffix to the target pathname while preserving its query and fragment.

Useful? React with 👍 / 👎.

getApiReference(teamId),
]);
return new Response(
buildLlmsTxt(settings, settings?.hideFromSearch ? [] : entries, Boolean(reference)),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Gate the API link when search visibility is off

When hideFromSearch is true, this passes an empty sitemap entry list but still advertises the OpenAPI spec whenever a reference exists. That leaves a content link in /llms.txt for a hidden site, contrary to the documented behavior that its list is empty. Gate hasOpenApi on the same visibility setting.

Useful? React with 👍 / 👎.

@s3rot0n1n
s3rot0n1n merged commit 9328c95 into main Nov 5, 2026
3 checks passed
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.

llms.txt and .md support

1 participant