Ignore Patterns
TheignorePatterns section allows you to define regular expressions that match URLs to be ignored during link checking.
Configuration
Behavior
- URLs matching any of the specified patterns will be skipped
- Patterns use regular expression syntax
- Each pattern is defined as an object with a
patternkey - Case-sensitive by default
Common Use Cases
Ignore FTP Links
Ignore Localhost URLs
Ignore Specific Domains
Ignore URL Paths
Regular Expression Tips
- Use
^to match the start of the URL - Use
$to match the end of the URL - Use
.*to match any characters - Use
\\.to match a literal period - Use
[^\\s]to match any non-whitespace character - Remember to escape special characters in YAML strings
Replacement Patterns
ThereplacementPatterns section lets you define regular expressions and replacement strings to modify URLs before checking them.
Configuration
Behavior
- Patterns use regular expression syntax with capture groups
- Replacements can reference capture groups using
$1,$2, etc. - Each entry requires both
patternandreplacementkeys - Transformations are applied before link checking
Common Use Cases
Normalize URL Format
https://example.com/user/123→https://example.com/id/123https://example.com/post/456→https://example.com/id/456
Convert Short URLs
Update Deprecated Paths
Transform Documentation Links
Replacement patterns are useful when you’ve migrated URLs but haven’t updated your documentation yet, or when dealing with dynamic URL structures.
Capture Groups
Capture groups allow you to extract parts of the URL and use them in the replacement:$1refers to the first capture group(https?://example.com)$2refers to the second capture group(\\w+)$3refers to the third capture group(\\d+)
Base URL
ThebaseUrl option sets the base URL used when checking relative links in your files.
Configuration
Behavior
- When a relative link is found, it’s converted to an absolute URL using the base URL
- Only applies to relative links (links that don’t start with a protocol)
- Useful when your documentation will be hosted at a specific domain
Example
With this configuration:/getting-started→https://docs.example.com/getting-started../api/reference→https://docs.example.com/api/referenceimages/logo.png→https://docs.example.com/images/logo.png
Absolute URLs (starting with
http:// or https://) are not affected by the baseUrl setting.Use Case: Static Site Testing
When building a static site that will be deployed to a specific domain:Complete Example
Here’s a comprehensive example combining all link pattern options:- Resolves relative links using
https://docs.example.comas the base - Skips localhost, FTP, and admin URLs
- Skips specific paths on example.com
- Updates API v1 URLs to v2
- Normalizes ID-based URLs to a consistent format