Skip to content

ci(docs): validate internal Starlight links (base-aware) #231

Description

@NachoVazquez

Summary

After the Astro Starlight migration (#229) and Diátaxis rewrite (#230), internal docs links use an explicit /lumberjack/ prefix because Astro does not auto-prepend base on markdown/MDX hrefs. That is correct for the GitHub Pages project site (base: '/lumberjack'), but nothing in CI fails if a next-steps target, redirect destination, or reference slug drifts.

Add starlight-links-validator (or equivalent) so broken internal links fail the docs build or a dedicated CI check.

Why

  • Markdown links are not base-relative by default; typos and renamed slugs (e.g. /guides/usage/guides/log-with-the-service) only show up in manual smoke or production.
  • TypeDoc reference pages are generated at build time under reference/** (gitignored). Link targets like /lumberjack/reference/core/classes/lumberjackservice/ must resolve against that output.
  • Review of docs: Diátaxis rewrite and TypeDoc API reference #230 flagged this as a cheap guardrail so the explicit /lumberjack/ convention stays honest.

Proposed approach

  1. Add starlight-links-validator to packages/docs/lumberjack-docs-app (Starlight plugin in astro.config.mjs).
  2. Confirm it respects base: '/lumberjack' (absolute same-origin links under the base).
  3. Run validation as part of nx build docs-lumberjack-docs-app and/or nx typecheck / a small lint target so CI’s existing nx affected -t lint build e2e catches failures.
  4. Optionally exclude external URLs if the plugin is noisy; keep internal + same-site checks strict.

Acceptance criteria

  • A deliberately broken internal link in a docs page fails CI (or the docs build) with a clear path + target.
  • Valid /lumberjack/... links to Getting Started, Guides, Understanding, What’s New, and generated Reference pages pass.
  • No requirement to drop the explicit /lumberjack/ prefix (that stays the correct pattern for this site).
  • Documented in a one-liner near the docs app config or project README if setup is non-obvious.

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestlumberjackApplies to issues of the Lumberjack project.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions