Skip to content

fix(links): update check relative links - #535

Merged
ChronosSF merged 2 commits into
vnextfrom
dtsvetkov/update-check-relative-links
Sep 8, 2026
Merged

fix(links): update check relative links#535
ChronosSF merged 2 commits into
vnextfrom
dtsvetkov/update-check-relative-links

Conversation

@dobromirts

Copy link
Copy Markdown
Contributor

Fixes #530.

Problem

list.mdx and themes/roundness.mdx linked Button Group as
/components/inputs/button-group, which 404s and check-relative-links passed.

The docs collection is rooted at content/<lang>/components
(docs/*/src/content.config.ts), so components/ is never a URL segment.
#468 moved the topic into xplat, which legitimately changed its URL from
/button-group to /inputs/button-group, but the links were rewritten with the
new file path rather than the new URL. (The same commit updated toc.json
correctly, because toc hrefs really are file paths.)

The check couldn't catch it: resolveAbsoluteLink carried a fallback candidate,
resolve(langRoot, path), encoding that same wrong model. The bad link matched a
real file on disk, so CI went green. That fallback had been there since the
checker landed in #355.

Content

  • The 2 links → /inputs/button-group.
  • One stale toc href: the Grid → Theming entry pointed at a page that doesn't
    exist in EN and was being silently dropped from the sidebar on all three xplat
    sites.

@ChronosSF ChronosSF left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verified the description against the repo and ran the new script against a fully generated local tree:

  • Both content configs root the docs collection at components, so the /components/... prefix rejection is correct, and the old resolve(langRoot, path) fallback was indeed what let #530 through.
  • Astro 7.2.6 strips a trailing /index from slugs, so the index-page candidates match what publishes.
  • The toc check mirrors docExists() in src/sidebar.ts (as-written plus .md/.mdx swap), and the not-synced-to-Angular filter matches shouldCopy() in sync-generated.mjs.
  • Against my local tree the PR script reports exactly the two /components/inputs/button-group links for Angular and the stale grids/theming-grid.mdx toc entry for the three xplat platforms, while the base script reported 81 Angular "not found" links that were all xplat-authored topics not yet synced locally. The second content root resolves those as intended.
  • The jp counterparts need no change: both jp Angular topics already use relative links, and the jp xplat source still has the grid theming page at grids/theming-grid.mdx, so its toc entry is consistent.

LGTM.

@ChronosSF ChronosSF added the ✅ status: verified Applies to PRs that have passed manual verification label Sep 8, 2026
@ChronosSF
ChronosSF merged commit b05d3b3 into vnext Sep 8, 2026
11 checks passed
@ChronosSF
ChronosSF deleted the dtsvetkov/update-check-relative-links branch September 8, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✅ status: verified Applies to PRs that have passed manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

⚠️[Urgent] Broken Button Group links in list.mdx and roundness.mdx

2 participants