mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
Closes DOCS-1753 ## Problem Guide pages already show a "Last updated" date (supabase/supabase#52421), but `sitemap.xml` has no `<lastmod>`, so crawlers get no recency signal. ## Solution - Guide entries in `sitemap.xml` now include `<lastmod>`. The date comes from the same `last_changed` table as the on-page date: the newest `last_updated` across a page's sections, written as an ISO 8601 timestamp. - The paginated `last_changed` read moved from `lib/last-changed.ts` into `lib/last-changed.utils.ts`. The new module has no `server-only` import, so the `tsx` sitemap script can share it. `getGuideLastUpdated` behaves the same, including its timeout, cooldown, and Sentry reporting. - When `NEXT_PUBLIC_SUPABASE_URL` or `SUPABASE_SECRET_KEY` is missing, or the read fails, the script logs a warning and writes the sitemap without `<lastmod>`. Local and preview builds still succeed. - `build:sitemap` in `apps/docs/turbo.jsonc` is now uncached and passes the two credentials through. The dates change nightly, outside the task's inputs, so a cache hit could otherwise restore stale dates. The task is cheap, and its dependencies stay cached. - Reference pages don't get `<lastmod>` because `last_changed` only tracks guides. - `sitemap.md` (marked TBD in the issue) is out of scope. ## Review instructions | Preview | Link | | --- | --- | | Docs sitemap | https://docs-git-claude-compassionate-dirac-ns0vjr-supabase.vercel.app/docs/sitemap.xml | | Docs app | https://docs-git-claude-compassionate-dirac-ns0vjr-supabase.vercel.app/docs | 1. Check the `build:sitemap` step in the Vercel build log. It should print `Total of N pages in sitemap (M with last-modified dates)`, where M is greater than 0. 2. In the preview deploy, open `/docs/sitemap.xml` and confirm that guide entries have `<lastmod>` values matching the "Last updated" date on those pages. 3. Optional local check: run `pnpm -F docs build:sitemap` without credentials. You should see the warning, and the sitemap should have no `<lastmod>` entries. Co-authored-by: Claude <noreply@anthropic.com>
Supabase Docs
This directory contains the Next.js app for supabase.com/docs.
Guides live in content/ as MDX. Reference pages are generated from the specs in spec/: OpenAPI, SDKSpec, ConfigSpec, and CLISpec. Some sections come from other repositories.
Where to go
- To write a page, follow the style guide.
- To find where a page lives, add one, or update generated reference docs, use the contributing guide. Library maintainers start at Reference structure.
- To use an agent, use the AI agent skills for docs authoring. Those skills include framing a page and placing it in the information architecture.
- To run the site locally, use the developers' guide.
- To add or change a redirect, read
lib/redirects/README.mdfirst.