Files
supabase/apps/docs/scripts/search_v2
Jeremias Menichelli 9623f958be feat: Produce sitemap and full markdown files for docs (#54069)
## Problem

Agents have no single index of the docs markdown exports, unlike the
KB's `sitemap.md`. www's `/llms.txt` and `/llms-full.txt` also read docs
files from disk, which forces www's build to wait on the docs build.

## Solution

**docs**
- Add `build:markdown-sitemap`, which writes
`public/markdown/sitemap.md`. It scans `public/markdown/**/*.md` and
lists each file as `[title](url.md)`. Guide URLs are
`/docs/guides/<page>.md` and the rest are `/docs/markdown/<page>.md`,
built with the existing `internal-links` helpers.
- Add `build:markdown-full`, which writes `public/markdown/full.md`. It
concatenates the same files.
- Both scripts share one file-list helper
(`internals/markdown-files.ts`), so they always cover the same files and
exclude `sitemap.md` and `full.md`.
- Both tasks depend on `build:markdown` and are wired into `build` in
turbo.
- Search v2 ingestion and the `docs.tar.gz` archive now ignore both
files.

**www**
- `/llms.txt` and `/llms-full.txt` now fetch `sitemap.md` and `full.md`
from `NEXT_PUBLIC_DOCS_URL`, replacing only their docs parts. Pricing,
product overviews, agent resources, the KB link and the customer stories
link are unchanged. If docs is unreachable, the docs section is left out
instead of returning a 404.
- Remove the on-disk docs reads, the `outputFileTracingIncludes`
entries, and the `docs#build:guides-markdown` dependency and docs input
globs from www's turbo config. These routes were the only link between
www and the docs build. `turbo-build.test.ts` is updated to match.
- Add a `/docs.md` → `/docs/markdown/sitemap.md` redirect, next to the
existing `/kb.md` one.

Routes without a markdown export are not patched, they are simply absent
from the sitemap.

## Review instructions

From the Docs preview link:

1. Open /docs/markdown/sitemap.md it should show a file with all links
to the docs pages available in markdown
1. Open /docs/markdown/full.md it should show a file with all the
content from all the pages

Sadly, only after deployed...
1. www project should return the content of both files when:
a. supabase.com/llms.txt is queried should return docs sitemap.md
content
b. supabase.com/llms-full.txt is queried should return docs full.md
content
1. supabase.com/docs.md should return sitemap.md file

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-12-01 09:11:29 +11:00
..