Skip to content

fix(ssg-md): emit discovery links independently of the hint - #3917

Open
SoonIter wants to merge 8 commits into
mainfrom
soon-codex/docs-llms-head-tags
Open

SoonIter wants to merge 8 commits into
mainfrom
soon-codex/docs-llms-head-tags

Conversation

@SoonIter

@SoonIter SoonIter commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Motivation

#3672 tied the HTML discovery links to injectLlmsHint. This could hide working Markdown and llms.txt URLs when the text hint was off, or when SSG-MD ran without HTML prerendering.

Changes

  • Write the Markdown alternate link and the llms.txt describedby link into each generated page’s HTML whenever the build generates SSG-MD output, including with ssg: false. Crawlers can read both links without executing JavaScript.
  • Document the links in the English and Chinese Custom Head guides.
  • Split the existing HTML head renderers into individual modules without changing their order.

Validation

Core build, 24 targeted unit tests, 12 end-to-end tests, and the full spelling check passed. The end-to-end tests verify the links in the generated HTML for both the homepage and a nested page.

Copilot AI balanced review requested due to automatic review settings December 3, 2026 04:13
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-12-03T04:13:49.869248Z
We couldn’t complete this review. Comment @codex review to try again.
24f4d8f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 6 projects in monorepo, 5 projects with changes.

📊 Quick Summary
Project Total Size Gzip Size Change Gzip Change
website_html 17.1 MB 2.5 MB +940.0 B (0.0%) -56.0 B (-0.0%)
website_md 2.3 MB 329.1 KB +2.3 KB (0.1%) +288.0 B (0.1%)
website_js 18.5 MB 3.2 MB +1.2 KB (0.0%) +102.0 B (0.0%)
new_project_html 495.9 KB 109.2 KB -101.0 B (-0.0%) -35.0 B (-0.0%)
new_project_js 670.3 KB 210.1 KB -184.0 B (-0.0%) -60.0 B (-0.0%)
new_project_md 18.6 KB 2.0 KB 0 0
📋 Detailed Reports (Click to expand)

📁 website_html

Path: website/doc_build/diff-rsdoctor/website_html/rsdoctor-data.json

📌 Baseline Commit: e9bb30953691c9057a175c61dbecc80abce1913b | PR: #3939

Metric Current Baseline Change
📊 Total Size 17.1 MB 17.1 MB +940.0 B (0.0%)
🗜️ Gzip Size 2.5 MB 2.5 MB -56.0 B (-0.0%)
📄 JavaScript 0 B 0 B 0
🎨 CSS 0 B 0 B 0
🌐 HTML 17.1 MB 17.1 MB +940.0 B (0.0%)
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: website_html Bundle Diff

📁 website_md

Path: website/doc_build/diff-rsdoctor/website_md/rsdoctor-data.json

📌 Baseline Commit: e9bb30953691c9057a175c61dbecc80abce1913b | PR: #3939

Metric Current Baseline Change
📊 Total Size 2.3 MB 2.3 MB +2.3 KB (0.1%)
🗜️ Gzip Size 329.1 KB 328.8 KB +288.0 B (0.1%)
📄 JavaScript 0 B 0 B 0
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 2.3 MB 2.3 MB +2.3 KB (0.1%)

📦 Download Diff Report: website_md Bundle Diff

📁 website_js

Path: website/doc_build/diff-rsdoctor/website_js/rsdoctor-data.json

📌 Baseline Commit: e9bb30953691c9057a175c61dbecc80abce1913b | PR: #3939

Metric Current Baseline Change
📊 Total Size 18.5 MB 18.5 MB +1.2 KB (0.0%)
🗜️ Gzip Size 3.2 MB 3.2 MB +102.0 B (0.0%)
📄 JavaScript 18.1 MB 18.1 MB +1.2 KB (0.0%)
🎨 CSS 204.4 KB 204.4 KB 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 221.7 KB 221.7 KB 0

📦 Download Diff Report: website_js Bundle Diff

📁 new_project_html

Path: e2e/fixtures/auto-nav-sidebar/doc_build/diff-rsdoctor/new_project_html/rsdoctor-data.json

📌 Baseline Commit: e9bb30953691c9057a175c61dbecc80abce1913b | PR: #3939

Metric Current Baseline Change
📊 Total Size 495.9 KB 496.0 KB -101.0 B (-0.0%)
🗜️ Gzip Size 109.2 KB 109.2 KB -35.0 B (-0.0%)
📄 JavaScript 0 B 0 B 0
🎨 CSS 0 B 0 B 0
🌐 HTML 495.9 KB 496.0 KB -101.0 B (-0.0%)
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: new_project_html Bundle Diff

📁 new_project_js

Path: e2e/fixtures/auto-nav-sidebar/doc_build/diff-rsdoctor/new_project_js/rsdoctor-data.json

📌 Baseline Commit: e9bb30953691c9057a175c61dbecc80abce1913b | PR: #3939

Metric Current Baseline Change
📊 Total Size 670.3 KB 670.5 KB -184.0 B (-0.0%)
🗜️ Gzip Size 210.1 KB 210.1 KB -60.0 B (-0.0%)
📄 JavaScript 588.5 KB 588.7 KB -184.0 B (-0.0%)
🎨 CSS 71.1 KB 71.1 KB 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 10.7 KB 10.7 KB 0

📦 Download Diff Report: new_project_js Bundle Diff

Generated by Rsdoctor GitHub Action

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Deploying rspress-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: fb927be
Status: ✅  Deploy successful!
Preview URL: https://1c34b210.rspress-v2.pages.dev
Branch Preview URL: https://soon-codex-docs-llms-head-ta.rspress-v2.pages.dev

View logs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The English and Chinese docs should clarify that enabling injectLlmsHint adds links even when llms: false disables built-in generation of their target files.

1 open issue
What changed in this PR

This docs-only PR explains the two discovery links Rspress added to statically generated HTML in #3672. It updates the English and Chinese docs without changing runtime behavior.

Changes:

  • Add both links to the Custom Head guides and point readers to injectLlmsHint.
  • Explain in the configuration reference that alternate points to the page’s Markdown and describedby points to the llms.txt index.
  • Add a page description to each Custom Head guide.
File Description
website/​docs/​zh/​guide/​advanced/​custom-head.mdx Lists both links and adds a page description.
website/​docs/​zh/​api/​config/​config-theme.mdx Explains both link targets under injectLlmsHint.
website/​docs/​en/​guide/​advanced/​custom-head.mdx Lists both links and adds a page description.
website/​docs/​en/​api/​config/​config-theme.mdx Explains both link targets under injectLlmsHint.

Review effort: Balanced


- In SSG HTML output, it renders a visually hidden plain-text DOM element near the top of the page. It does not use `display: none`, the `hidden` attribute, `aria-hidden`, or nested links, so agent-side HTML-to-Markdown conversion can preserve the directive as text.
- In SSG HTML output, it adds two links to `<head>`: `<link rel="alternate" type="text/markdown">` points to the page's Markdown version, and `<link rel="describedby">` points to the `llms.txt` index. It also renders a visually hidden plain-text DOM element near the top of the page. The element does not use `display: none`, the `hidden` attribute, `aria-hidden`, or nested links, so agent-side HTML-to-Markdown conversion can preserve the directive as text.
- In SSG-MD Markdown output, it renders a blockquote string near the top of the Markdown page.
@SoonIter
SoonIter force-pushed the soon-codex/docs-llms-head-tags branch from 24f4d8f to dc7b15b Compare December 3, 2026 06:46
@SoonIter SoonIter changed the title docs(llms): document the injected head links fix(ssg-md): emit discovery links independently of the hint Dec 3, 2026

This branch has not been deployed

No deployments
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