-
Notifications
You must be signed in to change notification settings - Fork 582
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
Added open-external-links.js to open external links in new tab #7540
Added open-external-links.js to open external links in new tab #7540
Conversation
Hello @rahulmansharamani14, Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here. |
Newest code from rahulmansharamani14 has been published to preview environment for Git SHA 985b96e |
@rahulmansharamani14 - It looks like all links are opening in new browser windows right now, rather than only external links. |
Hi @cwarnermm, Thank you for reviewing my PR and for your feedback. I wanted to clarify that, based on my testing, internal links are opening in the same tab, while external links are opening in new tabs, which is the intended behavior. Testing Details:
Internal Link:URL: http://127.0.0.1:8000/developer/contribution-guide.html Screenshot: External Link:URL: https://github.com/mattermost/mattermost-server Screenshot: Possible Reasons for Different Behavior:
Could you please let me know if there's a specific page or link where you're seeing all links opening in new tabs? I'd be happy to investigate further. If there's a particular environment or method you're using to build and serve the documentation, please share the details so I can replicate it. |
@rahulmansharamani14 - There's a generated preview of the product docs that uses the code in this docs PR. In that preview environment (which mirrors production), I'm continuing to see links to pages of the product docs that open in a new browser window. Examples include:
I haven't done an exhaustive search; however, a common pattern I'm seeing here is mid-page links (that should take the user to another section of the current document) opens a new browser tab. |
@rahulmansharamani14 - Are you open to addressing the outstanding issues on this docs PR? |
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
Closing due to inactivity. |
Summary
This PR ensures that all external links in the Mattermost documentation open in a new tab or window, addressing Issue #7048.
Changes Made
Added
open-external-links.js
:_static/js
directory.target="_blank"
to all external links.Updated
conf.py
:open-external-links.js
in the html_js_files list to include this file in the build process.Implementation Details
<a>
elements and checks if they have theexternal
class.target="_blank"
, opening them in a new tab/window.Testing
make clean build
.Notes
Thank you for reviewing my PR. I'm open to any feedback or suggestions.
Ticket Link
Fixes #7048