Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking internal links? #12

Open
fohrloop opened this issue Oct 27, 2024 · 0 comments
Open

Checking internal links? #12

fohrloop opened this issue Oct 27, 2024 · 0 comments

Comments

@fohrloop
Copy link

I see that in the plugins/deadlinks/deadlinks.py the internal links are explicitly skipped:

    for anchor in soup_doc(["a", "object"]):
        if "href" not in anchor.attrs:
            continue
        url = anchor["href"]

        # local files and other links are not really intresting
        if not url.startswith("http"):
            continue # <-- this part skips internal links like somepage#someanchor

        # Previous case works also for debugging environment (with SITEURL
        # being empty) This case resolves publish environment with all links
        # starting with http.
        if siteurl and url.startswith(siteurl):
            log.info("Url %s skipped because is starts with %s", url, siteurl)
            continue

Sometimes (after large refactoring, for example), it would be nice to check that internal links work, too. Basic support could just check the existence of the file. Supporting checking anchors would be even better.

Do you think the scope of the package could allow for including checks for internal links?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant