Skip to content

fix(docs): resolve relative links on nested documentation pages against the page directory - #26

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1789345167-nested-doc-links
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1789345167-nested-doc-links

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

On the 11 @rdlabo/eslint-plugin-rules rule pages (rules/*.md), cross-links to sibling rules were broken in both locales:

  • EN (package-hosted): [deny-element](./deny-element.md)/projects/eslint-plugin-rules/docs/deny-element (404; route is docs/rules/deny-element)
  • JA (portal-hosted): ./prefer-modal-launcher.md was left as a literal relative href because local pages never went through link rewriting

Root cause: rewritePackageDocLinks() rewrote *.md targets to /docs/{name} without knowing which directory the current page lives in.

Changes in scripts/package-markdown.ts / scripts/generate-docs.ts:

// resolve relative to the page: rules/prefer-modal-launcher.md + ./deny-element.md -> rules/deny-element
export function resolveRelativeDocSlug(path, pageFile?): string | undefined
export function rewriteRelativeDocLinks(markdown, pageFile): string          // for portal-hosted (local JA / localEnglishSource) pages
export function rewritePackageDocLinks(markdown, apiAnchors, landingSlug, pageFile?)  // new optional pageFile

Behaviour is unchanged when pageFile is omitted or the page is at the docs root, so all existing link tests still pass. ../README.md on nested pages still maps to the landing/API anchors as before.

Generated output regenerated with docs:generate:content; the only diff is 24 hrefs in eslint-plugin-rules.{en,ja}.generated.ts. workers-hono-kit JA pages also link to undeclared /docs/api-offline, /docs/api-testing, /docs/cli pages — that is a content gap, not a rewrite bug, and is left for a follow-up.

Validation (Node 24): fmt:check, lint, test (155 script tests + Angular suites), build:docs, build:web-site, seo:audit all pass. Baseline docs:generate:content on main produced zero drift before applying this change.

Link to Devin session: https://app.devin.ai/sessions/5c06cafe056340c684ce577fcb2dea10
Open in Devin Desktop: https://app.devin.ai/desktop/session/5c06cafe056340c684ce577fcb2dea10?variant=devin

…st the page directory

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@netlify

netlify Bot commented Sep 14, 2026

Copy link
Copy Markdown

Deploy Preview for capacitor-plugin-docs-stripe ready!

Name Link
🔨 Latest commit 7434acc
🔍 Latest deploy log https://app.netlify.com/projects/capacitor-plugin-docs-stripe/deploys/6aa73dacd849ba00084732bf
😎 Deploy Preview https://deploy-preview-26--capacitor-plugin-docs-stripe.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

0 participants