Skip to content

Enabling External Link Validity Checking #4009

@slusarz

Description

@slusarz

Is your feature request related to a problem? Please describe.

During build (or CI) process, external links should be checked for validity.

Currently, VP only checks localhost links. Other external links are just added as-is to the page. See

// catch localhost links as dead link

Describe the solution you'd like

At a minimum, ignoreDeadLinks callback option should be extended to return ALL links seen during parsing. VP admin can then write their own logic to do link checking.

Example:

ignoreDeadLinks: [
    (url) => {
        if (external_URL) {
            // Do link checking, i.e. with 'link-check' npm package
        } elseif (localhost_URL) {
            // Handle localhost checking.
        }
    }
],

Even better would be a way to continue to allow VP to handle localhost link checking and provide an option to handle external links separately.

Even even better might be that external link checking is simply built-in to VP, as an option. (E.g., Sphinx has this ability.). Simple example:

import 'linkCheck' from 'link-check'

// ...

linkCheck(url_to_check, function (err, result) {
    if (err) {
        throw new Error('Invalid Link: ' + err)
    }
});

Describe alternatives you've considered

No response

Additional context

More than willing to provide an MR to accomplish this, but since there are so many possibilities on how to allow/enable this I would rather wait for developer input to direct towards the best solution.

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions