Generate 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:
export default defineNuxtConfig({
linkChecker: {
report: {
publish: true
}
},
})
When the publish flag is set to true, the reports will be:
- Generated during the build process
- Copied to your public directory
- Available at the following paths once deployed:
- HTML report: https://nuxtseo.com/link-checker/link-checker-report.html
- Markdown report: https://nuxtseo.com/link-checker/link-checker-report.md
- JSON report: https://nuxtseo.com/link-checker/link-checker-report.json