Repository navigation
Serve public site content as Markdown for AI agents - #192
Conversation
- Add Markdown page routes, `.md` URLs, and `/llms.txt` - Include agent instructions in site configuration and Git sync
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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; |
There was a problem hiding this comment.
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)), |
There was a problem hiding this comment.
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 👍 / 👎.
Closes #27
Summary
.mdURLs andAccept: text/markdownnegotiation, plus Markdown 404 responses./llms.txtwith site instructions and links to public content; exclude hidden sites and deduplicate paths.agentInstructionsin site settings and Git import/export, and include page titles in sitemap data.Testing
.mdURLs, Accept negotiation,/llms.txt, Markdown 404s and normal HTML navigation.