Commit 0839701
authored
Improve docs Agent Score: LLM outputs, orphan-route cleanup, and URL formatting (#2926)
* Generate LLMS outputs and add HTML injector
Enable generation of site-wide llms.txt/llms-full.txt and per-page markdown (generateMarkdownFiles) so LLM tooling can index docs. Add a new llms-html-injector plugin to normalize generated .md paths, rewrite llms* URLs, and inject <link rel="alternate" type="text/markdown"> tags. Add a verification script (scripts/verify-llms-output.js), ignore its output in .gitignore (/.llms-verify), and remove the hand-maintained static/llms.txt in favor of generated rootContent/fullRootContent. Also update config include/exclude patterns and add related docs/service index updates; package dependencies were bumped (Docusaurus packages) and a new plugin implementation was added at src/plugins/llms-html-injector/index.js.
* Ignore .llms-verify and fix LLMS file read
Add .llms-verify/** to docusaurus ignore patterns and update scripts/verify-llms-output.js to read the LLMS output file once as a buffer (avoiding a TOCTOU race). Derive byte length from the buffer, convert to UTF-8 text, and use that text for all regex counts instead of calling fs.stat and multiple reads.
* Add /.llms-inspect to .gitignore
Ignore the .llms-inspect file by adding it to .gitignore. This prevents inspection output from LLMS tooling (similar to /.llms-verify) from being accidentally committed.
* Refactor LLMs generation and add static root index
Switch from auto-generating a monolithic llms.txt/llms-full.txt to a hand-curated static/llms.txt and per-section indexes. Wrap docusaurus-plugin-llms with an llms-html-injector wrapper so generation runs before post-processing (normalizing .md layout, rewriting llms*.txt URLs, and injecting <link rel="alternate">). Update docusaurus.config.js to disable the classic docs slot, disable root/full LLM generators, and adjust path transformations. Update scripts/verify-llms-output.js to mirror the new behavior (customLLMFiles list, disabled root generators, post-process step, and copy static/llms.txt into the verify outDir). Add static/llms.txt, add vercel redirects for the removed whats-new page, remove docs/whats-new.md, and tweak a navbar CSS comment. Export postProcessLlmsOutput for reuse by the verify script.
* Probe target existence before rename
Use fs.access as an explicit existence probe and distinguish an absent target from real I/O failures. The change introduces a targetExists flag and a try/catch around fs.access so that expected "not found" control flow proceeds to fs.rename, while genuine errors from fs.unlink (e.g. permission issues or locks) will propagate instead of being silently swallowed. A clarifying comment was also added to explain the reasoning.
* Docs: normalize URLs & disable orphan pages
Disable the default blog and the standalone Algolia search page and exclude quickstart builder fragments from the pages plugin to prevent orphan routes (Ahrefs orphan report). Replace CopyableNoFollow usages with inline/backticked RPC and explorer URLs across many MDX files and normalize links (e.g. web3.js → official docs, Nethereum guide URL). Update Ethereum Sepolia RPC to publicnode, remove src/pages/developer-tools/index.tsx, and apply minor layout/vercel config tweaks.
* Wrap RPC and explorer URLs in backticks
Update formatting in numerous embedded-wallets/connect-blockchain MDX files to wrap Public RPC URL and Block Explorer Link values in inline code (backticks) for consistent rendering across docs. Purely documentation/formatting changes with no functional code modifications.
* Wrap llms plugin to forward hooks and postBuild
Spread the upstream plugin object into the wrapper so any existing or future lifecycle hooks (e.g. contentLoaded, loadContent, configureWebpack, etc.) are forwarded unchanged. Override name to 'llms-html-injector' and override postBuild to first invoke the upstream postBuild using .call(inner, props) to preserve its context, then run postProcessLlmsOutput(props.outDir). Adds a clarifying comment explaining the forwarding rationale.
* Support non-root baseUrl when rewriting LLMS URLs
Compute and propagate the resolved site URL (url + baseUrl) so LLMS index rewrites and injected <link rel="alternate"> hrefs match deployments under a non-root base path. Added resolveSiteUrl(siteConfig) and require a siteUrl in postProcessLlmsOutput, then threaded siteUrl through rewriteLlmsIndexes and injectAlternateLinks. Updated the verify script to mirror docusaurus baseUrl resolution (honoring DEST env), import resolveSiteUrl, and pass the computed siteUrl to the post-processing step; also improved logging to show the siteUrl used. Includes a runtime check to fail if postProcessLlmsOutput is called without a siteUrl.
* Prefer MDX named exports for media metadata
Replace YAML front matter with JS named exports (contentType, mediaContent) in two quickstart MDX files and update toStep to prefer those named exports with frontMatter as a fallback. Also add typings and explanatory comments to Module so partial MDX imports (which can't carry front matter in Docusaurus 3.x) can provide contentType/mediaContent via exports.
* Remove Wallet LLMS entries from config and script
Delete the llms-wallet.txt and llms-wallet-full.txt entries from docusaurus.config.js and scripts/verify-llms-output.js. These entries previously configured generation of Wallet API LLMS outputs (short and full); removing them stops creation of those files and simplifies the LLMS configuration.
* Split Embedded Wallets LLMS and add middleware
Split the large llms-embedded-wallets full file into multiple smaller, sub-domain LLMS files (SDK, EVM, non-EVM, platform) and update docusaurus.config.js, the LLMS verification script, and static/llms.txt links to reflect the split to keep each file within LLM context limits. Add a Vercel Edge middleware (middleware.ts) to perform Accept: text/markdown content negotiation and rewrite requests to the corresponding .md siblings (replacing the previous vercel.json rewrite rule). Update vercel.json to remove the rewrites and add redirects for legacy llms wallet paths. Add @vercel/edge to package.json. Also fix minor docs formatting (remove trailing slashes from Monad block explorer links).
* Extract LLMS plugin options to module
Move llms plugin configuration into a single CommonJS module at src/plugins/llms-html-injector/options.js and make it the source of truth for both the production build and the verify script. docusaurus.config.js now requires and passes the shared options to the llms-html-injector plugin, and scripts/verify-llms-output.js imports the same options instead of duplicating arrays/objects. This eliminates silent-drift between the build and sanity-check logic and centralizes ignoreFiles, customLLMFiles, pathTransformation, and related flags (generateLLMsTxt, generateLLMsFullTxt, generateMarkdownFiles, etc.). The new module exports the full options object plus helper exports for customLLMFiles and ignoreFiles.
* Export plugin options as default object
Export the llmsPluginOptions object directly (module.exports = llmsPluginOptions) and remove the individual property exports. This avoids adding a self-referential property that would create a circular structure and crash Docusaurus' genSiteConfig during JSON.stringify; customLLMFiles and ignoreFiles remain accessible as properties on the exported object.
* docs: minor formatting and copy fixes
Apply small documentation improvements across embedded-wallets and tutorials: wrap tickers and scopes in code formatting, standardize MetaMask and opBNB casing, fix punctuation and spacing (including duplicate 'by'), consolidate an img tag into one line, adjust phrasing ('for free' -> 'at no cost'), and update Wagmi TabItem value to 'wagmi-tab' for clarity. These changes improve consistency and readability of the docs.
* Support .mdx and improve llms injector logging
Include .mdx in services LLMS globs so reference pages are not excluded; update llms-html-injector to warn when two source markdown files normalize to the same target, return/count a 'root' sentinel for intentionally skipped site-root index.html pages and surface that in the summary log. Add explanatory comments in docusaurus.config about the unused docs slot and Vercel cleanUrls behavior. Add Vercel redirects for /blog and /search to prevent orphaned routes.1 parent 9a85ba1 commit 0839701
159 files changed
Lines changed: 1644 additions & 993 deletions
File tree
- docs
- embedded-wallets
- connect-blockchain
- _general-connect-blockchain
- _react-native-connect-blockchain
- _unity-connect-blockchain
- evm
- aleph-zero
- ancient8
- arbitrum
- astar-zkevm
- astar-zkyoto
- avalanche
- base
- bitkub
- bnb
- celo
- chiliz
- cronos
- ethereum
- fhenix
- flare
- flow
- harmony
- hedera
- kinto
- klaytn
- linea
- manta
- metis
- mint
- monad
- moonbeam
- moonriver
- morph
- neon
- nibiru
- opbnb
- optimism
- polygon
- rootstock
- saakuru
- shardeum
- skale
- soneium
- songbird
- unichain
- xdc
- zetachain
- zilliqa
- zircuit
- other
- solana
- sdk
- _common
- react-native
- advanced
- usage
- unity
- usage
- metamask-connect
- evm
- quickstart
- reference/json-rpc-api
- solana/quickstart
- scripts
- services
- concepts
- get-started
- src
- pages
- developer-tools
- quickstart
- commonSteps
- tutorials
- plugins/llms-html-injector
- scss
- theme/DocItem/Layout
- static
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
7 | 11 | | |
8 | 12 | | |
9 | 13 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
13 | 21 | | |
14 | 22 | | |
15 | 23 | | |
| |||
162 | 170 | | |
163 | 171 | | |
164 | 172 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
175 | 190 | | |
176 | 191 | | |
177 | 192 | | |
| |||
181 | 196 | | |
182 | 197 | | |
183 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
184 | 211 | | |
185 | 212 | | |
186 | 213 | | |
| |||
323 | 350 | | |
324 | 351 | | |
325 | 352 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
484 | 375 | | |
485 | 376 | | |
486 | 377 | | |
| |||
775 | 666 | | |
776 | 667 | | |
777 | 668 | | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
778 | 673 | | |
779 | 674 | | |
780 | 675 | | |
| |||
785 | 680 | | |
786 | 681 | | |
787 | 682 | | |
788 | | - | |
789 | | - | |
790 | 683 | | |
791 | 684 | | |
792 | 685 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
| 14 | + | |
16 | 15 | | |
17 | | - | |
| 16 | + | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | | - | |
| 25 | + | |
27 | 26 | | |
28 | | - | |
| 27 | + | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
0 commit comments