Skip to content

docs: stop repeating the section prefix in generated Markdown links - #1135

Merged
marekh19 merged 2 commits into
masterfrom
fix/section-prefix-in-generated-md-links
Sep 22, 2026
Merged

marekh19 merged 2 commits into
masterfrom
fix/section-prefix-in-generated-md-links

Conversation

@marekh19

Copy link
Copy Markdown
Contributor

Part of apify/apify-web#6665

@signalwire/docusaurus-plugin-llms-txt@1.2.2 prepends the site URL to link paths that already carry the Docusaurus baseUrl, so the generated Markdown points at https://docs.apify.com/sdk/python/sdk/python/..., which 404s. It only happens on sites served under a sub-path.

The fix is already upstream in 2.0.0-alpha.6, but it does not look like it will be published soon: npm latest is still 1.2.2 and nothing has shipped since 2.0.0-alpha.7 in November 2025. This patch applies that same fix locally. Remove it once a stable 2.x lands.

Built here: llms-full.txt goes from 1040 doubled links to 0, llms.txt stays at 133 correct links.

The same patch goes into apify-cli, apify-sdk-js, apify-client-js and apify-client-python.

@marekh19 marekh19 added the t-web Issues with this label are in the ownership of the web team. label Sep 22, 2026
@marekh19
marekh19 requested a review from webrdaniel September 22, 2026 07:36
@codecov

codecov Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.69%. Comparing base (9aade20) to head (967365e).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1135      +/-   ##
==========================================
- Coverage   92.75%   92.69%   -0.06%     
==========================================
  Files          53       53              
  Lines        3519     3519              
==========================================
- Hits         3264     3262       -2     
- Misses        255      257       +2     
Flag Coverage Δ
e2e 32.73% <ø> (?)
integration 53.33% <ø> (ø)
unit 89.28% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@marekh19
marekh19 marked this pull request as ready for review September 22, 2026 07:43
@marekh19
marekh19 requested a review from B4nan September 22, 2026 07:43
@marekh19 marekh19 changed the title fix: stop repeating the section prefix in generated Markdown links docs: stop repeating the section prefix in generated Markdown links Sep 22, 2026
@marekh19
marekh19 marked this pull request as draft September 22, 2026 07:52
@marekh19
marekh19 marked this pull request as ready for review September 22, 2026 07:53
@marekh19
marekh19 marked this pull request as draft September 22, 2026 09:22
@marekh19
marekh19 marked this pull request as ready for review September 22, 2026 11:26
@marekh19
marekh19 merged commit ffbbef9 into master Sep 22, 2026
32 checks passed
@marekh19
marekh19 deleted the fix/section-prefix-in-generated-md-links branch September 22, 2026 12:04
marekh19 added a commit to apify/apify-docs that referenced this pull request Sep 24, 2026
Part of apify/apify-web#6665

`@signalwire/docusaurus-plugin-llms-txt@1.2.2` repeats the section
prefix in the `.md` files and `llms*.txt` it generates for sites served
under a sub-path, so roughly 6,700 links under `/sdk/{js,python}`,
`/api/client/{js,python}` and `/cli` 404.

Two changes at our edge:

- A 301 in `nginx.conf` collapsing the doubled prefix, so those links
resolve in one hop. Verified against the real GitHub Pages origins: 1
redirect, 200, correct `text/markdown`.
- The same substitution in `joinLlmsFiles.mjs`, so the root
`llms-full.txt` is correct in its own text. Verified against the real
production file: 6,664 doubled links to 0, nothing else touched.
`checkLlmsSize.mjs` now fails the build if any come back.

The sources are fixed separately in apify/apify-cli#1455,
apify/apify-sdk-js#737, apify/apify-sdk-python#1135,
apify/apify-client-js#1072 and apify/apify-client-python#1070. Drop the
`joinLlmsFiles.mjs` substitution once all five have deployed. Keep the
redirect: the doubled URLs stay in search indexes and agent caches long
after the sources are fixed.

It only collapses a repeated same-section prefix. The plugin also
prefixes cross-section links (`/sdk/js/cli/docs/...`), 5 of them in the
root `llms-full.txt`, which neither this nor the source fix addresses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-web Issues with this label are in the ownership of the web team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants