-
Notifications
You must be signed in to change notification settings - Fork 207
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
Fix links in "See also" section of the API docs. #291
Fix links in "See also" section of the API docs. #291
Conversation
@garg3133 Review Requested. I have been investigating to find any hard-coded redirect but there are none and entire docs have been updated with `/guide`. Afterwards, I found that there is if-else logic running for "See Also" section at, `nightwatch-docs/src/includes/api-method.ejs` In that, the line, `<li><code><a href="<%- appSettings.baseUrl.replace(/\/$/, '') -%>/api/<%- link.split('.').join('/') %>.html"><%= link %></a></code></li>` generates link accordingly. Now, after many workarounds, I cannot seem to budge the extra two dots that, `appSettings.baseUrl.replace(/\$/,'')` is appending after ".org" domain. I tried: [-] Slicing after replace with (0,-2), but instead of removing double dots, it gives out: https://nightwatchjs.o../<other-parts-of-url> [-] Writing new logic: Gives out same result I found that, replace() method is creating the problems. Simply removing it, works. Additionally, I added "/" in the BASE_URL in postdoc config. Do tell me if this is not right, or should I seek another way to solve the problem?
@ParmarKrishna Your solution does not seem to be working for me. Maybe you can try removing the complete baseUrl itself from the |
@garg3133 Review Requested. As per your suggestion, removing entire appSettings.baseUrl works. Pages seem to be redirected with directly `api`
@garg3133 Review Requested. As per your suggestion, removing entire baseUrl does work fine, for all the "See Also" sections. I did:
It works. Do let me know if this solution works for you, or should I look for other ways? PR #291 has been pushed with the changes. |
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.
Looks good. Can you remove all the unnecessary changes from the PR?
Adding the empty line at, line 19.
The PR title should contain a brief on what this PR does instead of just writing the issue number. |
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.
Looks good!
@garg3133 Review Requested.
I have been investigating to find any hard-coded redirect but there are none and entire docs have been updated with
/guide
.Afterwards, I found that there is if-else logic running for "See Also" section at,
nightwatch-docs/src/includes/api-method.ejs
In that, the line,
<li><code><a href="<%- appSettings.baseUrl.replace(/\/$/, '') -%>/api/<%- link.split('.').join('/') %>.html"><%= link %></a></code></li>
generates link accordingly.Now, after many workarounds, I cannot seem to budge the extra two dots that,
appSettings.baseUrl.replace(/\$/,'')
is appending after ".org" domain.I tried:
[-] Slicing after replace with (0,-2), but instead of removing double dots, it gives out: https://nightwatchjs.o../
[-] Writing new logic: Gives out same result
I found that, replace() method is creating the problems. Simply removing it, works. Additionally, I added "/" in the BASE_URL in postdoc config.
Do tell me if this is not right, or should I seek another way to solve the problem?