-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
Support setting a base for absolute links #452
Comments
Hi, we decided to not check absolute links by default, because it could generate a lot of false-positives when assuming the current directory as a root. For instance, many static site generators put files into a subfolder like
|
Hey Mathias! Thanks for the prompt answer! There might a bit of a confusion, my suggestion is not about path vs URLs. Here's what I propose:
What do you think? (oh and sorry for posting this in the wrong repo, I had both open and was distracted!) |
I've created a similar issue for another project: wjdp/htmltest#184 Basically, if you're generating for a specific subdirectory, it doesn't work as expected, for example:
works as expected.
It's trying to find files at If I hack it with:
now it works since paths will be evaluated like It would be great if either base or root could be set when running in local mode to say
|
Just revisited this issue and your suggestions make sense. We can use the examples for unit tests. I agree that there needs to be a separation between |
@mre don't know if this is a new issue, so I'll shortly discuss it here since it's (IMO) related to the feature described here, which doesn't (yet) exists: if you're deploying to most static site hosting platforms, they support the index file, where the URL https://example.com/foo/bar will route to
|
Your examples are for
You mentioned two examples in the other issue that we can use as tests:
I think all of this can be done with the current proposal (?). So if we have support for both |
@mre OK, I'll create another issue to discuss the missing index file resolving, thanks! |
Quick note to self: |
@mre any chance to get these It's currently difficult to get lychee working properly on a GitHub pages repository as GitHub pages publishes to a subdirectory unless you configure a custom domain. |
@vanbroup I just now figured how to solve it for me. In my case, we have a template site that when deploying to GitHub pages create absolute links internally. The template have a parameter in In it we have, for example, a page with path I am running
The |
Great workaround. |
It's nice the new remap feature is so flexible, but I agree it would be beneficial to provide a simpler UX for this. 👍 |
|
By default, lychee doesn't seem to check absolute links (
/
-prefixed), except when setting the--base
argument (this is weird by itself, since--base
should be for the resolution of absolute link as per documentation).It would be great to:
--root
argument that works like--base
but for absolute linksThe text was updated successfully, but these errors were encountered: