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

feat(link): add target="_blank" for external social links #2636

Closed
wants to merge 1 commit into from

Conversation

TinsFox
Copy link

@TinsFox TinsFox commented Nov 26, 2024

Add target="_blank" to Social Media Links

Description

This PR enhances the user experience of social media links by making them open in new tabs, allowing users to maintain their current browsing session while accessing external social platforms.

Changes Made

  • Added target="_blank" attribute to social media anchor tags
  • Maintains the main site navigation context for users
  • Follows web accessibility best practices

Before

Social media links would navigate away from the current page, disrupting the user's browsing experience.

After

Social media links now open in new tabs, preserving the user's current session on the main site.

Technical Details

Modified the social media link component:
html

- Add target="_blank" to social media links to open in new tab
- Improve user experience by keeping main site navigation intact
Copy link

changeset-bot bot commented Nov 26, 2024

⚠️ No Changeset found

Latest commit: 520abda

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the 🌟 core Changes to Starlight’s main package label Nov 26, 2024
Copy link

netlify bot commented Nov 26, 2024

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit 520abda
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/67453d93ea988700082359eb
😎 Deploy Preview https://deploy-preview-2636--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@astrobot-houston
Copy link
Collaborator

Hello! Thank you for opening your first PR to Starlight! ✨

Here’s what will happen next:

  1. Our GitHub bots will run to check your changes.
    If they spot any issues you will see some error messages on this PR.
    Don’t hesitate to ask any questions if you’re not sure what these mean!

  2. In a few minutes, you’ll be able to see a preview of your changes on Netlify 🤩

  3. One or more of our maintainers will take a look and may ask you to make changes.
    We try to be responsive, but don’t worry if this takes a few days.

@HiDeoo
Copy link
Member

HiDeoo commented Nov 26, 2024

Thanks for your contribution 🙌

The current behavior is actually an intentional design decision. We avoid opening links in new tabs by default as shown in various UX researches like this one from the Nielsen Norman Group. In general, it's best to avoid forcing a user to open something in a new tab and let them decide how they want to open a link, e.g. a basic click = same window, cmd/ctrl + click or middle click = new window/tab.

Thanks to Starlight component overrides, users can still explicitly opt-in to open links in new tabs even though we do not recommend it as the default behavior.

Considering the above, I'm going to close this PR. If you have any questions or concerns, feel free to reach out on Discord in the #starlight channel or open a new discussion.

@HiDeoo HiDeoo closed this Nov 26, 2024
@TinsFox
Copy link
Author

TinsFox commented Nov 26, 2024

Thanks for your contribution 🙌

The current behavior is actually an intentional design decision. We avoid opening links in new tabs by default as shown in various UX researches like this one from the Nielsen Norman Group. In general, it's best to avoid forcing a user to open something in a new tab and let them decide how they want to open a link, e.g. a basic click = same window, cmd/ctrl + click or middle click = new window/tab.

Thanks to Starlight component overrides, users can still explicitly opt-in to open links in new tabs even though we do not recommend it as the default behavior.

Considering the above, I'm going to close this PR. If you have any questions or concerns, feel free to reach out on Discord in the #starlight channel or open a new discussion.

I see, thank you for your reply and patient explanation ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 core Changes to Starlight’s main package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants