-
Notifications
You must be signed in to change notification settings - Fork 1.8k
docs: agent/crawler readiness — robots.txt, sitemap lastmod, ship the LLM surface #1616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
asclearuc
merged 9 commits into
rocketride-org:develop
from
EdwardLien0426:docs/RR-1615-agent-readiness
Jul 18, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b6e07df
docs: add robots.txt allowing AI crawlers
EdwardLien0426 bc39216
docs: keep committed robots.txt out of static/ gitignore
EdwardLien0426 2b765c0
docs: emit sitemap lastmod (showLastUpdateTime + sitemap options)
EdwardLien0426 9e2bafe
docs: stamp last_update from source git dates in gather
EdwardLien0426 a097b68
docs: warn in robots.txt that named groups shadow the wildcard
34faa1f
ci(docs): fetch full history so sitemap lastmod is real
341f789
fix(docs): tolerate CRLF front matter when stamping last_update
3ad6206
feat(docs): give llms.txt absolute URLs and per-link descriptions
5fb6877
fix(docs): scope front-matter parsing in gather (CodeRabbit)
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| import { describe, it } from 'node:test'; | ||
| import assert from 'node:assert/strict'; | ||
| import { createRequire } from 'node:module'; | ||
|
|
||
| const require = createRequire(import.meta.url); | ||
| const { pageDescription, stampLastUpdate } = require('../../scripts/lib/gather.js'); | ||
|
|
||
| describe('pageDescription', () => { | ||
| it('prefers a front-matter description when the page declares one', () => { | ||
| const md = '---\ntitle: Hi\ndescription: Declared up front.\n---\n\n# Hi\n\nProse instead.\n'; | ||
| assert.equal(pageDescription(md), 'Declared up front.'); | ||
| }); | ||
|
|
||
| // A block scalar's value is the indented run beneath it; the bare '>' or '|' | ||
| // indicator must never become the description. | ||
| it('reads a folded block-scalar description', () => { | ||
| const md = '---\ntitle: T\ndescription: >\n Folded across\n two lines.\n---\n\n# T\n\nProse.\n'; | ||
| assert.equal(pageDescription(md), 'Folded across two lines.'); | ||
| }); | ||
|
EdwardLien0426 marked this conversation as resolved.
|
||
|
|
||
| it('reads a literal block-scalar description', () => { | ||
| const md = '---\ntitle: T\ndescription: |\n Literal block.\n---\n\n# T\n\nProse.\n'; | ||
| assert.equal(pageDescription(md), 'Literal block.'); | ||
| }); | ||
|
|
||
| it('reads a chomped block-scalar description', () => { | ||
| const md = '---\ntitle: T\ndescription: >-\n Stripped fold.\n---\n\n# T\n\nProse.\n'; | ||
| assert.equal(pageDescription(md), 'Stripped fold.'); | ||
| }); | ||
|
|
||
| it('strips surrounding quotes from an inline description', () => { | ||
| assert.equal(pageDescription('---\ntitle: T\ndescription: "Quoted."\n---\n\n# T\n\nProse.\n'), 'Quoted.'); | ||
| }); | ||
|
|
||
| it('falls back to the first prose sentence, skipping the heading', () => { | ||
| const md = '---\ntitle: Hi\n---\n\n# Hi\n\nA pipeline is a graph. More after the stop.\n'; | ||
| assert.equal(pageDescription(md), 'A pipeline is a graph.'); | ||
| }); | ||
|
|
||
| it('skips MDX imports and JSX to reach the prose', () => { | ||
| const md = "---\ntitle: Q\n---\n\nimport { Foo } from 'react-icons';\n\n<Foo />\n\n# Q\n\nPick the path that suits you.\n"; | ||
| assert.equal(pageDescription(md), 'Pick the path that suits you.'); | ||
| }); | ||
|
|
||
| it('strips inline links and emphasis from the extracted sentence', () => { | ||
| const md = '# T\n\nSee the [engine](/concepts/engine) and **run** it.\n'; | ||
| assert.equal(pageDescription(md), 'See the engine and run it.'); | ||
| }); | ||
|
|
||
| it('returns an empty string when the page has no leading prose', () => { | ||
| assert.equal(pageDescription('---\ntitle: T\n---\n\n# T\n\n```js\ncode();\n```\n'), ''); | ||
| }); | ||
| }); | ||
|
|
||
| describe('stampLastUpdate', () => { | ||
| const D = '2026-07-16'; | ||
|
|
||
| it('merges into an existing front-matter block', () => { | ||
| const out = stampLastUpdate('---\ntitle: Hi\n---\n\n# Body\n', D); | ||
| assert.match(out, /^---\ntitle: Hi\nlast_update:\n {2}date: 2026-07-16\n---\n/); | ||
| }); | ||
|
|
||
| it('creates a front-matter block when the page has none', () => { | ||
| const out = stampLastUpdate('# Body\n', D); | ||
| assert.match(out, /^---\nlast_update:\n {2}date: 2026-07-16\n---\n\n# Body\n$/); | ||
| }); | ||
|
|
||
| // Regression: startsWith('---\n') was false on a CRLF checkout, so a SECOND | ||
| // front-matter block was prepended and `title` fell out into the body. | ||
| it('merges into CRLF front matter rather than prepending a second block', () => { | ||
| const out = stampLastUpdate('---\r\ntitle: Hi\r\n---\r\n\r\n# Body\r\n', D); | ||
| assert.equal((out.match(/^---\r?$/gm) || []).length, 2, 'exactly one front-matter block'); | ||
| assert.match(out, /title: Hi/); | ||
| assert.match(out, /date: 2026-07-16/); | ||
| // title must still be inside the front matter, not stranded in the body. | ||
| const fm = /^---\r?\n([\s\S]*?)\r?\n---/.exec(out)[1]; | ||
| assert.match(fm, /title: Hi/); | ||
| }); | ||
|
|
||
| // The guard reads the front matter only: a `last_update:` line in the body | ||
| // (a YAML code sample) must not cost the page its sitemap date. | ||
| it('stamps a page whose body merely mentions last_update', () => { | ||
| const md = '---\ntitle: T\n---\n\n# T\n\n```yaml\nlast_update:\n date: 2020-01-01\n```\n'; | ||
| assert.match(stampLastUpdate(md, D), /date: 2026-07-16/); | ||
| }); | ||
|
|
||
| it('is a no-op when the date is null or a date is already declared', () => { | ||
| assert.equal(stampLastUpdate('# B\n', null), '# B\n'); | ||
| const already = '---\nlast_update:\n date: 2020-01-01\n---\n\n# B\n'; | ||
| assert.equal(stampLastUpdate(already, D), already); | ||
| }); | ||
|
|
||
| it('does not treat a body horizontal rule as the front-matter close', () => { | ||
| const out = stampLastUpdate('---\ntitle: Hi\n---\n\n# Body\n\n---\n\nmore\n', D); | ||
| const fm = /^---\r?\n([\s\S]*?)\r?\n---/.exec(out)[1]; | ||
| assert.match(fm, /last_update/); | ||
| assert.match(fm, /title: Hi/); | ||
| }); | ||
| }); | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.