You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: docusaurus.config.js
+45-3Lines changed: 45 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -328,16 +328,47 @@ const config = {
328
328
{
329
329
// Set docsDir to site root to collect from all directories
330
330
docsDir: '.',
331
-
// Disable default files since we're generating section-specific files
332
-
generateLLMsTxt: false,
333
-
generateLLMsFullTxt: false,
331
+
// Generate a comprehensive root llms.txt + llms-full.txt covering every page
332
+
// (Agent Score: llms-txt-coverage check). The per-section files below remain
333
+
// useful as scoped indexes for AI tools.
334
+
generateLLMsTxt: true,
335
+
generateLLMsFullTxt: true,
336
+
// Emit an individual .md file next to every doc page so .md URLs return 200
337
+
// (Agent Score: markdown-url-support and llms-txt-directive-md checks). The
338
+
// companion llms-html-injector plugin (registered below) normalizes these
339
+
// files to URL-aligned paths and injects <link rel="alternate"> tags.
340
+
generateMarkdownFiles: true,
341
+
// Custom framing for the root index, preserving the prose previously
342
+
// hand-maintained in static/llms.txt.
343
+
rootContent: `> MetaMask is the leading self-custodial cryptocurrency wallet and Web3 gateway, enabling developers to build dapps that connect to the MetaMask browser extension and mobile app across EVM and Solana ecosystems.
344
+
345
+
This file follows the [llmstxt.org](https://llmstxt.org/) specification. Section-scoped indexes are also available:
fullRootContent: `> MetaMask is the leading self-custodial cryptocurrency wallet and Web3 gateway, enabling developers to build dapps that connect to the MetaMask browser extension and mobile app across EVM and Solana ecosystems.
356
+
357
+
This file contains the complete MetaMask developer documentation in a single markdown document, following the [llmstxt.org](https://llmstxt.org/) specification.
358
+
`,
334
359
// Ignore common non-doc directories
335
360
// Note: src/pages/** is not ignored so tutorials can be collected
336
361
// Each customLLMFiles entry filters by includePatterns, so only matching files are included
337
362
ignoreFiles: [
338
363
'node_modules/**',
339
364
'build/**',
340
365
'.docusaurus/**',
366
+
'.cursor/**',
367
+
'.github/**',
368
+
'.husky/**',
369
+
'.vscode/**',
370
+
'.integrationBuilderCache/**',
371
+
'scripts/**',
341
372
'static/**',
342
373
'src/components/**',
343
374
'src/theme/**',
@@ -349,12 +380,18 @@ const config = {
349
380
'src/specs/**',
350
381
'src/client/**',
351
382
'src/scss/**',
383
+
// Quickstart "builder" markdown is content fragments embedded by the
384
+
// builder UI, not standalone routes; include only the entry pages.
385
+
'src/pages/quickstart/builder/**',
386
+
'src/pages/quickstart/commonSteps/**',
352
387
'i18n/**',
353
388
'*.config.js',
354
389
'*.json',
355
390
'*.lock',
356
391
'README.md',
357
392
'CONTRIBUTING.md',
393
+
'AGENTS.md',
394
+
'LICENSE*',
358
395
'gator_versioned_docs/**',
359
396
],
360
397
excludeImports: true,
@@ -481,6 +518,11 @@ const config = {
481
518
],
482
519
},
483
520
],
521
+
// Runs in postBuild after docusaurus-plugin-llms generates files. Normalizes
522
+
// .md files to URL-aligned paths, rewrites llms*.txt URLs to match, and
523
+
// injects <link rel="alternate" type="text/markdown"> into every doc page's
0 commit comments