delucis / starlight-links-validator

Astro integration for Starlight to validate internal links

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

starlight-links-validator 🦺

Astro integration for Starlight to validate internal links.

Screenshot of starlight-links-validator

Features

An Astro integration for Starlight Starlight to validate internal links in Markdown and MDX files.

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

Installation

Install the Starlight Links Validator integration using your favorite package manager, e.g. with pnpm:

pnpm add starlight-links-validator

Update your Astro configuration to include the Starlight Links Validator integration before the Starlight integration:

  import starlight from '@astrojs/starlight'
  import { defineConfig } from 'astro/config'
+ import starlightLinksValidator from 'starlight-links-validator'

  export default defineConfig({
    // …
    integrations: [
+     starlightLinksValidator(),
      starlight({
        sidebar: [
          {
            label: 'Guides',
            items: [{ label: 'Example Guide', link: '/guides/example/' }],
          },
        ],
        title: 'My Docs',
      }),
    ],
  })

License

Licensed under the MIT License, Copyright © HiDeoo.

See LICENSE for more information.

About

Astro integration for Starlight to validate internal links

License:MIT License


Languages

Language:TypeScript 89.9%Language:MDX 7.4%Language:JavaScript 2.2%Language:Shell 0.5%