Repository navigation
Docs SEO Update: Phase 1 - #1147
Merged
Merged
Conversation
The build already ran next-sitemap, but the sitemap never reached production: it was written to public/ after the static export had been copied to out/docs, its <loc> values were relative (siteUrl '/'), and nginx redirected /docs/sitemap.xml to /docs/en/sitemap.xml, which serves the HTML 404 page. - next-sitemap: absolute URLs under https://thegraph.com/docs, written into the export at out/docs, 404/500 pages excluded - nginx: exempt /docs/sitemap.xml from the /docs/en/ locale redirect - sitemap-ci.js: read the sitemap from its new location and keep the route lockfile's site-relative /en/... format - route-lockfile: drop /en/404/, now excluded from the sitemap Addresses finding 1 ("No valid XML sitemap anywhere") of the December 2026 SEO audit: graph-gtm-kit/internal/seo-audit/december-2026-audit/ thegraph-seo-audit.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HpT75vHTnTdhKizaBwz8Yq
The /docs/en/ location fell back to the 404 page inside `try_files`, which serves it as a normal file with status 200. Every mistyped or removed docs URL therefore looked like a valid page to crawlers, which Google reports as a "soft 404" and can index. `try_files` now ends in `=404`, and `error_page 404` shows the same localized 404 page, so visitors see no difference but the status is 404. Found while testing the redirect fixes for the December 2026 SEO audit (graph-gtm-kit/internal/seo-audit/december-2026-audit/thegraph-seo-audit.md); not one of its listed findings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HpT75vHTnTdhKizaBwz8Yq
The Supported Networks page hides the content header that renders the page title as an H1, and its top heading was an H2, so the page had no H1 at all. That heading is now a `Heading.H1`, with the same id. MDX content only styles h2-h6, so it takes the H2 classes it had (size, white text, top margin) explicitly, and looks as before. Fixes finding 7 of the December 2026 SEO audit (graph-gtm-kit/internal/seo-audit/december-2026-audit/thegraph-seo-audit.md). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HpT75vHTnTdhKizaBwz8Yq
No docs page declared a canonical URL, so search engines had to guess which of a page's variants (with or without a trailing slash, with a query string, through a redirect) to index. Every page now has a `<link rel="canonical">` to its own absolute URL, `https://thegraph.com/docs/en/<path>/`, always with a trailing slash and never with a query string or hash (the home page is `https://thegraph.com/docs/en/`). It is built in `Layout` from Nextra's `useFSRoute`, the page's path, which is the same in the HTML rendered at build time and in the browser. The docs' URL lives in one constant, `DOCS_URL` in `src/layout/seo.ts`. The 404 page, which is served for every missing URL, declares none. Fixes finding 2 of the December 2026 SEO audit (graph-gtm-kit/internal/seo-audit/december-2026-audit/thegraph-seo-audit.md). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HpT75vHTnTdhKizaBwz8Yq
`_app.tsx` gave every page `og:url` = `https://thegraph.com/`, so every shared docs link told social networks and crawlers that it was the homepage, and previews could merge or point there. `_app.tsx` no longer sets it, and `Layout` sets `og:url` to the page's canonical URL. The 404 page, which has no URL of its own, sets none. Not one of the findings of the December 2026 SEO audit (graph-gtm-kit/internal/seo-audit/december-2026-audit/thegraph-seo-audit.md); found while adding the canonical tags for its finding 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HpT75vHTnTdhKizaBwz8Yq
The docs had no structured data, so search engines could not show breadcrumbs for docs results or tell what kind of page each one is. `Layout` now emits JSON-LD on every docs page: - a `TechArticle` with the page's headline (its `og:title`, else its title), description, image, canonical URL, `inLanguage`, and The Graph as publisher. No `dateModified`: no real date is available yet (see the TODO about `timestamp` in `Layout`). - a `BreadcrumbList` from the nav trail, starting with "Docs" (`https://thegraph.com/docs/en/`). Nav folders that have no page of their own are skipped rather than given made-up URLs; a network's page, which is not in the nav, gets Supported Networks as its parent. The home page, a hub rather than an article, gets a `WebSite` instead, and the 404 page gets none. `<` is escaped in the serialized JSON so it can never close the script tag. The builders live in `src/layout/seo.ts`. Fixes finding 9 of the December 2026 SEO audit (graph-gtm-kit/internal/seo-audit/december-2026-audit/thegraph-seo-audit.md). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HpT75vHTnTdhKizaBwz8Yq
"Supported Networks" alone says nothing about whose networks they are, in search results, in browser tabs, or in shared links. The page's H1 now reads "The Graph Supported Networks", from a new `index.supportedNetworks.pageTitle` string, and a front-matter `seo` override gives it the same `og:title` and the tab title "The Graph Supported Networks | Docs | The Graph" (so its `TechArticle` headline matches too). The front-matter `title` and the `index.supportedNetworks.title` string are unchanged, so the left nav, the breadcrumbs and the home page's section heading still say "Supported Networks". Follows up on finding 7 of the December 2026 SEO audit (graph-gtm-kit/internal/seo-audit/december-2026-audit/thegraph-seo-audit.md), whose fix made this heading the page's H1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HpT75vHTnTdhKizaBwz8Yq
Network detail pages (/supported-networks/<network>/) had no H1: the
network name is an h2, and so was the first heading of each network's
custom content ("Indexing Data on Ethereum" and so on).
- The first heading of every customContent file (88) is now a level-1
heading, so it becomes the page's single H1.
- NetworkDetailsPage maps that h1 to Heading.H1 styled exactly like the
h2 it replaced (content styles only target h2 and below), and keeps
its anchor id (e.g. #indexing-data-on-ethereum), since Nextra only
generates ids from h2 down.
- A network page without custom content falls back to the network name
as its H1, so a future network can't ship without one.
The MDX heading lint (.remarkrc.mjs) only covers src/pages, so these
snippets aren't subject to its no-h1 rule. Checked in a dev server: one
H1 per page, same computed style as before, `pnpm lint` passes.
Addresses finding 7 of the December 2026 SEO audit, applied to the docs:
graph-gtm-kit/internal/seo-audit/december-2026-audit/thegraph-seo-audit.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HpT75vHTnTdhKizaBwz8Yq
…dates Nextra reads each page's last-modified date from git while building, but `.dockerignore` excluded `.git`, so the production image build never had any history: `timestamp` was always undefined (hence the old "Why is `timestamp` undefined?" TODO), no page showed its "Last updated" date, and `TechArticle` had no `dateModified`. - .dockerignore: keep `.git` in the build context. Only the builder stage sees it; the final image copies just `out/`. The Dockerfile already installs git, and the image workflow already checks out full history (fetch-depth: 0, blob:none), which Nextra's git reader handles: it gave the same dates on a blobless clone as on a full one. - TechArticle gets `dateModified` from that date. - Pages built from a template (`[locale]/...`: home, network pages, 404) get no date, since theirs would be the template file's, not their content's. Visible effect: docs pages now show the "Last updated" date the layout already renders when it has one. Checked in a dev server: quick start and tokenomics show 2026-11-30 (their last commit, #1138) in both the page and `dateModified`; the homepage and network pages show none. Addresses finding 9 (structured data) of the December 2026 SEO audit: graph-gtm-kit/internal/seo-audit/december-2026-audit/thegraph-seo-audit.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HpT75vHTnTdhKizaBwz8Yq
juanmardefago
approved these changes
Dec 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the docs findings from the December 2026 SEO audit (
graph-gtm-kit/internal/seo-audit/december-2026-audit/thegraph-seo-audit.md), plus two issues found along the way. Each change is its own commit.Indexing and crawling
/docs/sitemap.xml(audit finding 1). The build already rannext-sitemap, but the file never shipped: it was written topublic/after the static export, its URLs were relative, and nginx redirected/docs/sitemap.xmlto an HTML page. It's now written intoout/docswith absolutehttps://thegraph.com/docs/en/...URLs and served directly. The 404/500 pages are left out.sitemap-ci.jsreads the new location, and the route lockfile keeps its format (only the/en/404/line goes)./docs/en/URLs showed the 404 page with status200, which Google treats as a "soft 404". They now return404with the same page.Head tags
https://thegraph.com/docs/en/<path>/, built from the route at export time. The 404 page gets none.og:urlper page. Every page declaredog:url = https://thegraph.com/(hard-coded in_app.tsx), so link previews treated each docs page as the homepage. It now equals the canonical.BreadcrumbListandTechArticleJSON-LD on docs pages, andWebSiteon the homepage. Helpers live in the newlayout/seo.ts.Headings
og:titlematch. The left nav and the homepage section heading still say "Supported Networks".Notes for review
http://redirect hop. fix(nginx): redirect to https, so none drops to http #1146 fixed the same thing on main, so this branch was rebuilt on top of it. The sitemap commit keeps fix(nginx): redirect to https, so none drops to http #1146'shttps://$hostredirects and only addssitemap\.xmlto the locale-redirect exception.Docs > Page. Network pages getDocs > Supported Networks > Network..dockerignoreexcluded.git, so the production build had no git history and pages never got a last-modified date..gitnow stays in the build context (builder stage only; the final image is unchanged), soTechArticlegetsdateModifiedand pages show the "Last updated" date the layout already renders. Templated pages (home, network pages, 404) get none.docs-seo-phase-2). The two merge cleanly in either order.Testing
/docs/sitemap.xmlservestext/xmlwith no redirect, redirects go straight tohttps://, and missing/docs/en/pages return404with the docs 404 page.next-sitemapandsitemap-ci.json route data from the lockfile. That produced 193 absolute URLs and no 404 entry, and the regenerated lockfile matches the committed one.og:urlon the homepage, quick start, a deep manifest page, About, Supported Networks and network pagespnpm lintandtscpass, and prettier passes on the changed files.🤖 Generated with Claude Code
https://claude.ai/code/session_01HpT75vHTnTdhKizaBwz8Yq