-
Notifications
You must be signed in to change notification settings - Fork 79
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
Allow skipping rel=canonical links (via config or built-in) #175
Comments
@JustinBeckwith we would start working on a contribution right now but hesitate because it would be better to hear your opinion on the right approach. We prefer a fixed convention to not check absolute Adding a config flag is good, too but if it's not needed It's a maintenance burden. |
Hey @nkuehn, thank you for really digging into explaining your workflow, and what's going on here - and I really appreciate the offer to cut a PR! Thinking out loud - I would imagine that in most cases, wouldn't folks want to make sure the url used in On the solution space - right now I'm leaning in 1 of 2 directions. Naively - would it be possible for you to use the On the other hand - I do think there's value in providing a way to opt specific HTML elements out of link checking (as opposed to the link skip). Where I'm not sure on the right approach is the "how". The Thoughts? |
Sure! .... if the build that they are just testing on the filesystem is not changing any addresses. If the build that's being tested on the filesystem is changing a page's address, it will fail because canononical links should be absolute and naturally it won't exist yet on the remote server (at least Google asks for that - "Use absolute paths rather than relative paths with the rel="canonical" link element.")
I would have to exclude my own production hostname for that. We actually do this right now to be able to use a canonical tag at all with linkinator. But it's coming with the unwanted side effect that every time some author uses an absolute URL it's not checked any more. Plus, some parts of the content under that domain belong to another system, so they have to be written as absolute links and should be link-checked. Ideas
I like the last most TBH. |
Did you have the opportunity to take a look at the idea I proposed in the PR? |
FYI I closed the PR now, we're covering the problem with the new URL rewriting feature now. Rewriting the production domain to the current preview domain. It has side effects but for now does the job. |
We're stuck with a workflow problem that our previous link checker (ruby based HTMLProofer) solves with the ability to annotate specific DOM elements to be ignored by the link checker by adding a
data-proofer-ignore
attribute.Here's the workflow issue:
<link rel="canonical" ...>
head information that points to the live production domain's absolute URL. That link is checked by linkinator, too - which is generally the right approach and a nice feature that all sorts of URLs are checked.Since the canonical link generation is not a potential source of broken links we would like to exclude it.
Any objections against contributing either an option to generally exclude the canonical tag if it's a local filesystem check and the canonical target is remote or to support an HTML attribute
skip-link-checker
that does not require configuration?The text was updated successfully, but these errors were encountered: