Guides

Generate Reports

Last updated by
Harlan Wilton
in doc: link to real reports.

Introduction

The Nuxt Link Checker module can generate reports of the broken links in your application. This is useful for CI environments where you want to see the results of the link checker without having to run it in your local environment.

Generating Reports

There are three reports available: html, markdown and json.

  • html: a human readable report that can be opened in your browser.
  • markdown: can be consumed by LLMs tools or embedded within GitHub pull requests.
  • json: a machine readable report that can be used in your CI

To generate them, you can provide the report option:

export default defineNuxtConfig({
  linkChecker: {
    report: {
      // pick and choose which reports you want to generate
      html: true,
      markdown: true,
      json: true,
    }
  },
})

The reports will be output in the following paths:

  • html: ./output/link-checker-report.html
  • markdown: ./output/link-checker-report.md
  • json: ./output/link-checker-report.json

Publishing Public Reports

Keeping your links healthy can be a lot of effort and be frustrating when you you are blocked in your CI pipeline due to them.

For this reason, you may want to publish your link checker reports as publicly accessible files after your deployment. These will be non-indexable but directly accessible by anyone.

You can make your link checker reports accessible after deployment by using the publish flag:

nuxt.config.ts
export default defineNuxtConfig({
  linkChecker: {
    report: {
      publish: true
    }
  },
})

When the publish flag is set to true, the reports will be:

  1. Generated during the build process
  2. Copied to your public directory
  3. Available at the following paths once deployed:
Did this page help you?