Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

starlight-links-validator

HiDeoo52.3kMIT0.16.0

Starlight plugin to validate internal links.

starlight, plugin, links, validation, astro

readme

starlight-links-validator 🦺

Starlight plugin to validate internal links.

Screenshot of starlight-links-validator

Getting Started

Want to get started immediately? Check out the getting started guide.

Features

A Starlight plugin to validate internal links in Markdown and MDX files.

  • Validate internal links to other pages
  • Validate internal links to hashes in other pages
  • Validate internal links to hashes in the same page
  • Ignore external links
  • Run only during a production build

License

Licensed under the MIT License, Copyright © HiDeoo.

See LICENSE for more information.

changelog

starlight-links-validator

0.16.0

Minor Changes

  • #104 cbeaa0f Thanks @HiDeoo! - Ignores query strings when checking for excluded links.

    Previously, to exclude links with query strings, you may have needed to rely on fairly loose glob patterns, e.g. /playground/** to exclude /playground/, /playground/?id=foo and /playground/?id=bar. With this change, excluding /playground/ will ignore all query strings, so /playground/, /playground/?id=foo and /playground/?id=bar will all be excluded.

0.15.1

Patch Changes

  • #102 88e66a8 Thanks @HiDeoo! - Fixes a regression with version 0.15.0 where the errorOnLocalLinks option was not being applied correctly.

0.15.0

Minor Changes

  • #93 6d7174b Thanks @HiDeoo! - ⚠️ BREAKING CHANGE: The minimum supported version of Starlight is now version 0.32.0.

    Please use the @astrojs/upgrade command to upgrade your project:

    npx @astrojs/upgrade
  • #100 b238cb7 Thanks @HiDeoo! - Adds a new sameSitePolicy option to configure how external links pointing to the same origin as the one configured in the Astro site option should be handled.

    The current default behavior to ignore all external links remains unchanged. This new option allows to error on such links so they can be rewritten without the origin or to validate them as if they were internal links.

  • #100 b238cb7 Thanks @HiDeoo! - Adds a new components option to define additional components and their props to validate as links on top of the built-in <LinkButton> and <LinkCard> Starlight components.

Patch Changes

0.14.3

Patch Changes

  • #91 1ef31b8 Thanks @DaniFoldi! - Moves mdast-util-mdx-jsx package to non-dev dependencies to prevent issues in monorepos with hoisting disabled.

0.14.2

Patch Changes

  • #85 57fdb1b Thanks @HiDeoo! - Improves error message for invalid links to custom pages.

0.14.1

Patch Changes

  • #82 b3cbee8 Thanks @HiDeoo! - Fixes regresion introduced in version 0.14.0 of the plugin regarding validation of links to pages with custom IDs/slugs.

    Note that you must use at least Astro version 5.1.1 to benefit from this fix.

  • #80 876cb50 Thanks @lukekarrys! - Fixes validation issues for pages ending in index, e.g. module_index.

0.14.0

Minor Changes

  • #77 486a379 Thanks @HiDeoo! - Adds support for Astro v5, drops support for Astro v4.

    ⚠️ BREAKING CHANGE: The minimum supported version of Starlight is now 0.30.0.

    Please follow the upgrade guide to update your project.

    When using the plugin with the Content Layer API, the plugin will now automatically invalidate the content layer cache so that all links can be properly validated. To avoid unnecessary cache invalidation, it is recommended to conditionally use the plugin only when necessary. Check out the new “Conditional Validation” guide for more information.

    ⚠️ BREAKING CHANGE: Due to a regression in Astro v5, links to pages with custom IDs/slugs can no longer be validated and will be flagged as invalid. If you rely on this feature, please stay on a previous version of Starlight and Astro in the meantime.