Skip to content

Make external links open in new tabs #15025

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

Closed
wants to merge 2 commits into from
Closed

Conversation

asafashirov
Copy link
Contributor

Summary

  • Add functionality to make external links open in new tabs while keeping internal links as is
  • Reduce bounce/exit rates by keeping users on pulumi.com when following external links
  • Allow users to easily navigate back to pulumi.com without losing their place
  • Add security protection with rel='noopener' to prevent new tab from accessing opener window

Implementation

  • Add a new TypeScript file that runs when the page loads
  • Detect all links and check if they point outside the pulumi.com domain
  • Add target='_blank' attribute only to external links
  • Keep internal navigation behavior unchanged

Test plan

  1. Load any page with external links
  2. Click on external links to verify they open in new tabs
  3. Click on internal links to verify they stay in the same tab
  4. Check browser console for any errors

- Add IndexNow API implementation in scripts/search/indexnow.js
- Create shell wrapper in scripts/search/submit-indexnow.sh
- Integrate with build pipeline in ci-push.sh
- Add Makefile target for manual submission
- Include API key in GitHub workflow environment
- Add test scripts to verify API functionality

This implementation submits new and updated URLs to search engines
via the IndexNow protocol, allowing for faster indexing of content.
…ehavior

- Add new external-links.ts script to identify external links
- Add target='_blank' to external links only
- Add rel='noopener' for security
- Import the new script in main.ts
- Keep internal navigation behavior unchanged
@pulumi-bot
Copy link
Collaborator

Copy link
Contributor

@thoward thoward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asafashirov This PR seems to include two different changes: IndexNow and also external link behavior changes. Can you split these into separate PRs?

@asafashirov
Copy link
Contributor Author

@thoward i must of branched off a previous pr's branch instead of main. i couldn't remove the indexnow commit from this pr so closing this one and opened a new one: #15080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants