VuePress EcosystemVuePress Ecosystem
  • Theme Guidelines
  • theme-default
  • Hope Theme
  • Plume Theme
  • Reco Theme
  • Feature Plugins
  • Markdown Plugins
  • Search Plugins
  • Blog Plugins
  • PWA Plugins
  • Analytics Plugins
  • SEO Plugins
  • Development Plugins
  • Tool Plugins
  • @vuepress/helper
  • English
  • 简体中文
GitHub
  • Theme Guidelines
  • theme-default
  • Hope Theme
  • Plume Theme
  • Reco Theme
  • Feature Plugins
  • Markdown Plugins
  • Search Plugins
  • Blog Plugins
  • PWA Plugins
  • Analytics Plugins
  • SEO Plugins
  • Development Plugins
  • Tool Plugins
  • @vuepress/helper
  • English
  • 简体中文
GitHub
  • append-date
  • markdown-container
  • markdown-ext
  • markdown-image
  • markdown-include
  • markdown-hint
  • markdown-math
  • markdown-stylize
  • markdown-tab
  • links-check
  • prismjs
  • revealjs
    • revealjs
    • Slide Demo
    • Reveal.js Themes
  • shiki

links-check

@vuepress/plugin-links-check

This plugin will check dead links in your markdown files.

This plugin has been integrated into the default theme.

Usage

npm i -D @vuepress/plugin-links-check@next
.vuepress/config.ts
import { linksCheckPlugin } from '@vuepress/plugin-links-check'

export default {
  plugins: [
    linksCheckPlugin({
      // options
    }),
  ],
}

Options

dev

  • Type: boolean

  • Default: true

  • Details:

    Whether check dead links in markdown in devServer

build

  • Type: boolean | 'error'

  • Default: true

  • Details:

    Whether check dead links in markdown in build. If set to 'error', the build will fail if there are dead links.

exclude

  • Type: (string | RegExp)[] | ((link: string, isDev: boolean) => boolean)

  • Details:

    The links that should be excluded from checking. You can use a list of strings or regular expressions, or a function that returns a boolean.

  • Example:

    .vuepress/config.ts
    import { linksCheckPlugin } from '@vuepress/plugin-links-check'
    
    export default {
      plugins: [
        linksCheckPlugin({
          exclude: [
            // exclude links by string
            '/exclude-link',
            // exclude links by regex
            /\/exclude-link-regex/,
          ],
    
          // or exclude links by function
          exclude: (link, isDev) => {
            if (isDev) {
              return link.startsWith('/exclude-link-dev')
            }
            return link.startsWith('/exclude-link-build')
          },
        }),
      ],
    }
Edit this page on GitHub
Last Updated:: 4/12/25, 7:03 PM
Contributors: Mister-Hope
Prev
markdown-tab
Next
prismjs