-
Notifications
You must be signed in to change notification settings - Fork 81
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
Local folder with subfolders #82
Comments
Ahh, that's not how To get this to work today - you'd have to run
|
The thing is that if I do that then linkinator cannot find the root. So I'm stuck :/ |
I suppose I'm a little confused. What do you mean by not being able to "find the root"? Effectively - linkinator expects that it starts from a single crawling point, and can follow links to all other links it wants to be checked. Are you saying that the subdirectories throughout your structure also have independent roots that need to be crawled? |
If I do Maybe adding a root option could help in such cases. I'm not sure how I can make linkinator work in this case. Here's a WIP branch https://github.com/XhmikosR/nodejs.org/tree/master-xmr-linkinator |
Thank you - I get it now! All linkinator does when you point it at a directory is naively spin up a web server from the CWD to serve requests. You could do something very similar:
|
Thanks for the reply! The problem with this approach is that it's not cross-platform, unfortunately. Also, http-server is broken BTW. I personally use the serve package, but it seems I'm having some issues in this case. That being said, I'll see what I can cook up. I still believe a new option for linkinator to load files from is useful though. Also a thing I notice from a quick test is that linkinator throws for the link dns-prefetch links. |
Alright, I successfully managed to set a CLI solution but that scans only one locale. So, I figure we need to use the API, right? Not very familiar with it but it seems linkinator returns a Promise so my first attempt doesn't work. If you have any time, here's my WIP branch with the API solution nodejs/nodejs.org@master...XhmikosR:master-xmr-linkinator-2 First, I want to at least land the English locale CLI scanning on nodejs/nodejs.org#2565 and then see how we can improve things with using the API directly. |
Using the API seems like the right thing to do here for sure. Linkinator does return a promise from the |
Just wanted to check in @XhmikosR - did you end up getting this rolling with the API? I was thinking alternatively - you could create an index page at the root level (mostly for testing purposes) that has a link to all of the per-language root pages, and then scan that page. |
@JustinBeckwith I started a patch one day nodejs/nodejs.org@1cdc841 but never got to tweak it :/ Do not hesitate to PR if you have some time :) We definitely get some false positives, but my plan is to just keep a list of whitelisted domains, which will be better than nothing. |
Hi, I have a similar setup with microsites under the root that link to each other. I am now throwing an index.html with nothing but It would be great if the use case would be covered by the CLI, too since it's pretty good already with colored output, grouping etc. Conceptually the issue is about being able to separate the first entrypoint from the scope of the recursion and the root path of the local webserver. So what about an optional flag
With the effect that the local webserver is started on (could be a plural form too, taking multiple entrypoints) Does that make sense? What do you think? |
I think I may have finally cracked this nut 😆 The latest version of linkinator (2.6 and up) now supports passing multiple locations, and it supports globbing. So you should be able to do something like this:
This will do a top level scan (you can of course use
@XhmikosR @nkuehn want to take this for a spin and let me know how it goes? |
@JustinBeckwith sounds like a nice solution, I'll give it a try. Thanks for the update! Is the |
Any time we check a link, regardless of the top level root path, it will be added to a cache and not checked again. So no double checking :) On the matching logic - the |
Thanks for the clarification! It's a bit embarassing but I think I am not understanding what the Given my file layout
when I call
but had hoped for
I can work around it by temporarily copying |
The paths you pass into
Or you could say:
|
The latter you propose was what I initially tried, but what I get is
the version output is 2.7.0. "websites" accidentally also contains an |
🎉 This issue has been resolved in version 2.11.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thanks, using the server root works now! |
@JustinBeckwith: I'm trying to add linkinator in the nodejs.org repo.
The file structure there is like this:
So, if I do
linkinator build/ --recurse
it fails because it doesn't see an index.html. If I dolinkinator build/en --recurse
then I get false positives because linkinator can't find the root.Is there a workaround or something you could do about it?
Thanks in advance!
The text was updated successfully, but these errors were encountered: