creativecommons / vocabulary

A cohesive system of design for Creative Commons
https://vocabulary-docs.netlify.app
Creative Commons Zero v1.0 Universal
7 stars 64 forks source link

[Feature] Add target attribute to anchor tags #290

Open shivam8112005 opened 21 hours ago

shivam8112005 commented 21 hours ago

Problem

Currently, external links do not open in a new tab, which can disrupt user navigation and make it inconvenient to return to the original page after visiting a linked resource.

Description

This feature proposes adding the target="_blank" attribute to relevant anchor tags some of the anchor tags already posses target="_blank" but some are didn't therefore add it throughout the project. By doing so, users will be able to open external links in new tabs, allowing them to retain their place on the current page while easily accessing additional resources.

Alternatives

An alternative solution would be to inform users to right-click and select "Open link in new tab." However, this is not user-friendly and may not be obvious to all users. Implementing the target="_blank" attribute is a more intuitive solution that enhances user experience without requiring additional actions.

Additional context

Opening external links in new tabs is a widely accepted practice on the web. It aligns with user expectations and improves overall navigation efficiency.

Implementation

possumbilities commented 12 hours ago

Vocabulary is a framework, not a functioning app, so this is a detail that would be left at the implementation layer, not assumed as the Design System level.

The only place I could see this being relevant might be links that are a part of the framework, that would always be external links no matter where they are implemented.

Feel free to document all of those cases if they exist on the Issue. Moving to https://github.com/creativecommons/vocabulary/labels/%F0%9F%A7%B9%20status%3A%20ticket%20work%20required for now.

shivam8112005 commented 11 hours ago

Vocabulary is a framework, not a functioning app, so this is a detail that would be left at the implementation layer, not assumed as the Design System level.

The only place I could see this being relevant might be links that are a part of the framework, that would always be external links no matter where they are implemented.

Feel free to document all of those cases if they exist on the Issue. Moving to 🧹 status: ticket work required Needs more details before it can be worked on for now.

Hey @possumbilities I am talking about files in context folder I have mentioned some of them still im not sure here target attribute is not present:

  1. https://github.com/creativecommons/vocabulary/blob/6ca20f226b7022adb0518310c8b946cdc13b14e8/specimen/contexts/archive-page.html#L159
  2. https://github.com/creativecommons/vocabulary/blob/6ca20f226b7022adb0518310c8b946cdc13b14e8/specimen/contexts/blog-index.html#L401
  3. https://github.com/creativecommons/vocabulary/blob/6ca20f226b7022adb0518310c8b946cdc13b14e8/specimen/contexts/blog-index.html#L425
  4. https://github.com/creativecommons/vocabulary/blob/6ca20f226b7022adb0518310c8b946cdc13b14e8/specimen/contexts/blog-index.html#L434 but here target is _blank:
    1. https://github.com/creativecommons/vocabulary/blob/6ca20f226b7022adb0518310c8b946cdc13b14e8/specimen/contexts/archive-page.html#L177
    2. https://github.com/creativecommons/vocabulary/blob/6ca20f226b7022adb0518310c8b946cdc13b14e8/specimen/contexts/archive-page.html#L240