-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Replace JavaScript link fix with custom plugin #10714
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
Conversation
|
@usha-mandya @StefanScherer PTAL This is my first time writing anything in Ruby, so it's mostly "copy/paste" and "code-by-numbers" using a good amount of StackOverflow. I tried building the docs locally, verified that pages such as |
|
oh, interesting; The |
|
|
This replaces the JavaScript link fix script with a custom plugin, based on the jekyll-relative-link plugin, and modified so that it can be used as Liquid "filter". While it borrows from the jekyll-relative-links plugin, it takes some shortcuts; - We use the code from jekyll-relative-links plugin to find/extract links on the page - Relative links are converted to absolute links, using the path of the markdown source file that's passed as argument - After conversion to an absolute link, we strip the ".md" extension; no attempt is made to resolve the file that's linked to. This is different from the jekyll-relative-links plugin, which _does_ resolve the linked file. This functionality could be added in future by someone who has more experience with Ruby. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
ceeacd7 to
9cab419
Compare
|
Deploy preview for docsdocker ready! Built with commit 9cab419 |
usha-mandya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested some random links and they all work fine.
|
Not merging it yet to give Stefan a chance to review the Ruby updates. |
StefanScherer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I only saw missing links to the API versions 1.24, 1.29, ..., but that's probably because the Netlify preview does not have all pages in it.
This is a follow-up to #10549
This replaces the JavaScript link fix script with a custom plugin, based on the jekyll-relative-link plugin, and modified so that it can be used as Liquid "filter".
While it borrows from the jekyll-relative-links plugin, it takes some shortcuts;