Link audit
Find orphaned pages and broken internal links.
Link audit
The lazysite-audit.pl script scans the docroot for orphaned pages
(pages that exist but are not linked from anywhere) and broken internal
links (links pointing to pages that do not exist).
Invocation
perl plugins/audit.pl [options] [docroot]
The docroot defaults to the current directory.
Options
--exclude path,path,...- comma-separated canonical paths to exclude from the orphan report (e.g.,--exclude index,404)--exclude-file FILE- file containing one exclusion per line
What it scans
- All
.mdfiles for Markdown link syntax and HTMLhref/srcattributes - Cached
.htmlfiles for.urlpages (since remote content is not re-fetched) - All
.ttfiles underlazysite/templates/for template links
What it skips
- External links (
http://,https://) - Mailto links, fragment-only links (
#), data URIs - Asset file extensions (images, fonts, CSS, JS, PDFs, archives, media)
- Paths starting with
assets/ - Links containing TT variables (
[%) - Files in the
lazysite/directory (system files)
Report format
ORPHANED PAGES (N)
/path source-file.md
BROKEN LINKS (N)
source-file.md -> /target
SUMMARY
Source pages: N
Orphaned: N
Broken links: N
Default exclusions
404 and index (root page) are always excluded from the orphan
report.
Notes
- Canonical paths strip the file extension and normalise
/indexto the parent path - The audit is read-only - it does not modify any files
- Run after adding new pages to find unlinked content