Skip to content

feat: Add last updated date and structured data to docs pages - #21070

Merged
sfanahata merged 5 commits into
masterfrom
feat/docs-last-updated
Dec 4, 2026
Merged

sfanahata merged 5 commits into
masterfrom
feat/docs-last-updated

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

DESCRIBE YOUR PR

Refs DEVEX-942

Adds a "Last updated" date to every docs page that has a source file, so readers, search engines, and LLMs can tell how fresh a page is. Also adds schema.org breadcrumb data to docs pages, and website and organization data to the home page.

Where the date comes from

  • scripts/last-modified.ts runs one git log --first-parent --no-renames --name-only over docs/ and develop-docs/ when generate-doctree runs, and stores the newest commit date for each page's sourcePath as lastModified on the doc tree node. Pages that inherit shared common/ content get the date of that shared file.
  • Vercel clones only the last 10 commits. With a shallow clone, git dates nearly every file to the oldest cloned commit. When the clone is shallow, the script first runs git fetch --unshallow --filter=blob:none origin <HEAD>, which fetches the commit history without file contents. Vercel's checkout has no origin remote, so the script adds one from VERCEL_GIT_REPO_OWNER and VERCEL_GIT_REPO_SLUG when it's missing. If history is still unavailable, it logs a warning and leaves dates out instead of showing wrong ones. The build never fails because of this.
  • Commits in .git-blame-ignore-revs (formatting) and the new .last-updated-ignore-revs (bulk edits that don't change what a page says) don't count as updates. Without that, hundreds of pages would show the dates of docs: De-duplicate platform SDK meta descriptions #19123 (meta description de-dupe) and docs: Add trailing slashes to internal links to avoid redirects #19639 (trailing slashes). A file that only ignored commits touched still gets their date.
  • Only .md/.mdx changes count, so image-only commits don't move the date.

Where the date shows up

  • Under the page description, as Last updated: <time datetime="…">Month D, YYYY</time>. Versioned pages (__v…) don't show it, since they have their own source files.
  • As schema.org dateModified in a TechArticle JSON-LD block (headline, description, dateModified, the canonical url, and Sentry as publisher), next to the visible date. Google asks for the two to match, so both use UTC.
  • As <lastmod> in sitemap.xml.
  • As last_updated in the Markdown export frontmatter. This changes every export once, so the first build after merge re-uploads them all to R2.

Other structured data

  • Every docs page gets a BreadcrumbList built from the same items as its visible breadcrumbs, with canonical URLs. Google can show this path in search results instead of the raw URL.
  • The home page gets a WebSite (name "Sentry Docs") and an Organization for Sentry, with its logo and social profiles. The Organization uses the same @id as the one on sentry.io (https://sentry.io/#organization), so search engines treat both as one entity. The logo is a new public/sentry-logo.png (512×512, from src/logos/sentry-logo-dark.svg), because the logo URL in sentry.io's own markup redirects to a login page.
  • A shared JsonLd component renders all JSON-LD blocks, and SENTRY_ORGANIZATION keeps the home page Organization and the TechArticle publisher the same.

Known limits

  • Edits to includes/ and platform-includes/ don't move a page's date yet. Rolling include dates up into the pages that use them can come later.
  • pnpm dev builds the doc tree without git dates, so the line doesn't render locally. Use the Vercel preview.
  • Generated API reference pages have no source file, so they don't get a date.

Open decisions

  • Should docs: De-duplicate platform SDK meta descriptions #19123 (meta-description rewrite on ~250 pages) count as an update? It's in .last-updated-ignore-revs for now, because it only changed SEO descriptions.
  • Placement and styling of the visible date (currently small gray text under the description).

IS YOUR CHANGE URGENT?

  • Urgent deadline (GA date, etc.): YYYY-MM-DD
  • Other deadline: YYYY-MM-DD
  • No deadline: Not urgent, can wait up to 1 week+

PRE-MERGE CHECKLIST

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

via shannon.anahata.

--

View Session [Sentry]

Derive each page's last updated date from the last commit that changed
its source file, computed once when the doc tree is generated. Show it
under the page description, and expose the same date as schema.org
dateModified, as sitemap lastmod, and in the Markdown export frontmatter.

Vercel clones only 10 commits, so the build fetches the commit history
(without file contents) first, and leaves dates out if it can't. Bulk
edits listed in .last-updated-ignore-revs and .git-blame-ignore-revs
don't count as updates.

Refs DEVEX-942

Co-Authored-By: Shannon Anahata <shannon.anahata@sentry.io>
@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
develop-docs Ready Ready Preview Dec 3, 2026 8:48pm UTC
sentry-docs Ready Ready Preview Dec 3, 2026 8:48pm UTC

Request Review

@linear-code

linear-code Bot commented Dec 2, 2026

Copy link
Copy Markdown

DEVEX-942

Comment thread scripts/generate-md-exports.mjs Resolved
Pages with an MDX override in md-overrides/ rebuilt their export
frontmatter without the doc tree's last updated date.
Vercel's build checkout has no origin remote, so the history fetch
failed and the build skipped last updated dates. Add origin from
VERCEL_GIT_REPO_OWNER and VERCEL_GIT_REPO_SLUG when it's missing.

Co-Authored-By: Shannon Anahata <shannon.anahata@sentry.io>
Add a BreadcrumbList that matches the visible breadcrumbs on docs pages,
and WebSite and Organization data on the home page. The Organization
uses the same @id as sentry.io so search engines treat them as one
entity. Move the JSON-LD script tag into a shared component.

Co-Authored-By: Shannon Anahata <shannon.anahata@sentry.io>
@sentry-junior sentry-junior Bot changed the title feat: Show last updated date on docs pages feat: Add last updated date and structured data to docs pages Dec 2, 2026
@sfanahata sfanahata self-assigned this Dec 3, 2026
* structured date to match.
*/
export function LastUpdated({date, title, description}: Props) {
const structuredData = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm just brushing up on JsonLd types, but I think adding the canonical url and even publisher here would be a nice boone to SEO/AEO so the robots associate the structured data with a specific resource.

The url would serve a different semantic purpose than what's happening with the breadcrumb list. But I think you could get the canonical url from resolvePageCanonical() in the same imported utils that are used in the breadcrumb util.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good call, added both in 1fd733d3c. url is the page's canonical URL from resolvePageCanonical(), the same value as the <link rel="canonical"> tag, so it also follows customCanonicalTag. publisher is Sentry as an Organization with the same @id (https://sentry.io/#organization) as the home page and sentry.io, so they all point at one entity. That object now lives in jsonLd.tsx, so the home page and the article data share it.

via shannon.anahata.

@jaffrepaul jaffrepaul left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I added a comment about JsonLd types that could beef this up 👍

Ties the TechArticle to its canonical page URL and to Sentry as the
publisher, using the same Organization @id as the home page and
sentry.io.
@sfanahata
sfanahata merged commit 774e4ea into master Dec 4, 2026
34 checks passed
@sfanahata
sfanahata deleted the feat/docs-last-updated branch December 4, 2026 19:27

This branch was successfully deployed

2 active deployments
Preview – sentry-docs — 1fd733d3 Deployed Dec 3, 2026 by vercel[bot]
Preview – develop-docs — 1fd733d3 Deployed Dec 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Normal Docs review has no urgent deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants