Skip to content

docs: make validate passes with dead /rules/<cat>/<slug> links; add an internal link check to the docs gate #322

Closed

Description

@nc9

While rewriting the rule docs (#315) a batch shipped /rules/performance/<slug> hrefs for pages that live at /rules/perf/<slug>. cd docs && make validate (tangly check --strict) reported "All checks passed" with those dead links in place. The lane caught it with its own script (every /rules/<cat>/<slug> link must resolve to docs/rules/<cat>/<slug>.mdx).

Acceptance Criteria

  • make validate in docs/ fails on any internal markdown link whose target page does not exist (relative and absolute /path links, with and without anchors).
  • The check runs in the public CI "Docs check and build" job.
  • A test fixture or a documented manual repro shows the failure on a dead link and the pass on a fixed one.
  • If tangly has a flag or config for this, it is enabled and documented in docs/README instead of a custom script.

Part of #638.

Activity

  1. added
    documentation
    P3
    size: S
    on Sep 23, 2026
  2. nc9 commented on Oct 11, 2026

    @nc9
    ContributorAuthor

    Checked against current main (ad95fb2): STILL TRUE, and bumping tangly will not fix it.

    On a three-page fixture, tangly check --strict 0.5.0 (pinned in docs/package.json) and 0.5.2 (npm latest) both pass [d](/rules/performance/real) where only /rules/perf/real exists. They also pass ./nope-rel, <Card href="/nope-card"> and a dead #anchor. In 0.5.0, dist/cli/commands/check.js validates only the manifest and MDX syntax. Its --no-links option is declared and never read, and nothing else checks links in page bodies.

    That answers criterion 4: tangly has no flag or config for this, so the check has to be a script in the "Docs check and build" job. The anchor half is #649, and one script could cover both.

  3. nc9 commented on Oct 16, 2026

    @nc9
    ContributorAuthor

    Fixed in #876 (bb528c3). make validate and bun run docs:check, which the CI "Docs check and build" job runs, now run docs/scripts/check-links.ts after tangly check --strict. It fails on an internal link (absolute, relative or same-page, with or without an anchor) whose target is not a page, a redirect or a file. docs/scripts/check-links.test.ts has fixtures for a dead absolute link, a dead relative link and /rules/performance/<slug>, plus passing cases. The last criterion does not apply: tangly 0.5.0 and 0.5.2 have no flag or config for it (a probe with dead links passed --strict), and CONTRIBUTING.md documents the script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3choredocumentationsize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions