Skip to content

Make chain & token tables searchable#156

Merged
pavlovdog merged 1 commit into
mainfrom
search-indexable-chain-token-tables
Jun 18, 2026
Merged

Make chain & token tables searchable#156
pavlovdog merged 1 commit into
mainfrom
search-indexable-chain-token-tables

Conversation

@pavlovdog

Copy link
Copy Markdown
Contributor

Problem

Searching a chain name like Arbitrum or Tempo (or a token name) in the docs search bar returned no suggestion pointing to the relevant page.

The supported-chains and supported-tokens tables were imported as MDX components from data/*.md:

import SupportedChains from "../../../data/supported-chains.md"
<SupportedChains />

Vocs builds its search index from page source and strips imports/components (and [!include] directives) before extracting text. So the chain and token names — which only existed inside the imported data files — were never indexed.

Fix

  • Replace the component imports with {/* @data-start: <key> */}{/* @data-end: <key> */} marker comments in the pages.
  • Add scripts/render-data.ts (pnpm render-data) which injects the generated markdown from data/<key>.md between the matching markers. The content becomes literal page text and is indexed normally; the marker comments are themselves stripped by the indexer, so they stay invisible to readers and search.
  • The rendered pages are now the committed source of truth. data/ becomes a build-time-only artifact and is gitignored.
  • docs-data-updater is unchanged — it still just emits artifacts to data/. The update-docs-data workflow now runs render-data after generating data and commits the rendered pages.

Pages affected: guides/supported-chains (chains + chain-details), references/paymaster/erc20-paymaster/supported-tokens, guides/how-to/erc20-paymaster/supported-tokens.

Verification

  • pnpm search-index builds clean.
  • After the change, the built index contains the chain/token names and a search for Tempo resolves to /guides/supported-chains.
  • render-data is idempotent; --check mode reports staleness for CI.

🤖 Generated with Claude Code

The supported-chains and supported-tokens tables were imported as MDX
components from data/*.md. Vocs' search indexer reads page source and
strips imports/components before indexing, so the chain and token names
were never indexed — searching "Arbitrum" or "Tempo" returned no result
pointing to the supported-chains page.

Replace the component imports with @data-start/@Data-end marker comments
and add a render-data script that injects the generated markdown directly
into the pages between those markers. The content is then literal page
text and gets indexed normally; the markers themselves are stripped by
the indexer so they stay invisible.

The rendered pages are now the committed source of truth, so data/ is a
build-time-only artifact and is gitignored. docs-data-updater is
unchanged (still emits artifacts to data/); the update-docs-data workflow
runs render-data after generating data and commits the rendered pages.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jun 18, 2026 1:55pm

Request Review

@pavlovdog pavlovdog merged commit 882e7e4 into main Jun 18, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants