Files
supabase/apps/docs/features/docs
03c2008987 feat(docs) - add last updated date (#52421)
## Problem

Per #52168, dates are a really important signal for LLMs. We should be
surfacing this more proactively across our docs, pulling from the
lastModified date.

## Solution

Looks like this information is already stored in a Supabase table, so we
can grab the date values and then render on associated pages.

To this end, this PR:
- Grabs the last-updated date with a script (with tests on the script).
Gets all the dates to form a map, and then have all the pages read from
that map to save roundtrips. Still ~20+ lookups b/c of how the site is
built (by multiple workers).
- Adds that date into the Guides template and associated JSON-LD /
opengraph structured data.

The goal of these dates -- to answer the various CodeRabbit comments --
are to be an **approximation** of age. It's okay if they're not 100%
accurate based on changed titles, frontmatter, deleted heading sections,
etc.

Reading this via JS instead of a SQL lookup to save us a DB migration,
as that's the fastest way to get this change up (and I have very little
familiarity with db migrations, so partially just lack of knowledge
here).

This does add some additional latency to builds, approximately ~20
seconds from some build benchmarking:
-
https://vercel.com/supabase/docs/7UcfoR3Jjb8SYuUNkRo14W3DZqBL#L1221-L1241
-
https://vercel.com/supabase/docs/23RH6uPtR92K8EggPPiTEQvY23bk#L1062-L1085

## Preview links

| state | preview |
| -------|------|
| after | <img width="891" height="438" alt="image"
src="https://github.com/user-attachments/assets/38476245-be80-4b65-99a7-4501e60560fc"
/> |

- [Queues
overview](https://docs-git-kody-devrel-751-docs-last-updated-date-supabase.vercel.app/docs/guides/queues)
-- rendered date of Oct 19th matches [git last
modified](https://github.com/supabase/supabase/commits/master/apps/docs/content/guides/queues.mdx)
- [Cron
overview](https://docs-git-kody-devrel-751-docs-last-updated-date-supabase.vercel.app/docs/guides/cron)
-- rendered date of Feb 23rd slight diff from git last modified... but
matches last [content
change](https://github.com/supabase/supabase/commits/master/apps/docs/content/guides/cron.mdx)
- [Auth
overview](https://docs-git-kody-devrel-751-docs-last-updated-date-supabase.vercel.app/docs/guides/auth)
-- rendered date of Oct 22nd matches [git last
modified](https://github.com/supabase/supabase/commits/master/apps/docs/content/guides/auth.mdx)

## Gaps / open review questions

- **testing** - Least familiar with the tests in
`apps/docs/lib/last-changed.test.ts` + these are entirely claude
generated. Unsure if they hit what they should.
- **build latency** - Is ~20 sec / build acceptable latency here? If we
wanted to move forward with SQL instead of JS to try and reduce it,
could make sense... but I'd definitely need help on the associated db
migration here.
- **build fragility** - AI review flagged the cooldown / potential
hanging requests without a timeout. Seems like this is now addressed,
but obviously could use a sanity check.

---------

Co-authored-by: Claude Haiku 5.5 <noreply@anthropic.com>
Co-authored-by: anthony lio <lionnet.ant@gmail.com>
2026-11-02 08:00:09 -06:00
..