Skip to content
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 nightwatchjs.org links across the website #289

Open
garg3133 opened this issue Mar 21, 2024 · 3 comments
Open

Fix nightwatchjs.org links across the website #289

garg3133 opened this issue Mar 21, 2024 · 3 comments

Comments

@garg3133
Copy link
Member

garg3133 commented Mar 21, 2024

If you look through the newly deployed Nightwatch.js website, there are a lot of links (especially in the "See Also" section of /api/ docs) that are pointing to the other locations on the same website but are broken.

See the links present in the "See also" section on this page for example.

To fix this issue, we'd need to remove the base URL (https://nightwatchjs.org) from the links pointing to /guide or /api pages, like done in commit 31ba9d3.

@beatfactor
Copy link
Member

Should be fixed on #288

@GRIMSTER44
Copy link

@garg3133 Sir im working on it

@garg3133
Copy link
Member Author

The issue is fixed for the Guide docs in #288 but the issue remains in the API docs. I've updated the issue description with the details of the same.

ParmarKrishna added a commit to ParmarKrishna/nightwatch-docs that referenced this issue Mar 26, 2024
@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?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants