hugo-PaperMod icon indicating copy to clipboard operation
hugo-PaperMod copied to clipboard

[FEATURE] optional special handling of external links

Open David-Guillot opened this issue 1 year ago • 5 comments
trafficstars

What does this PR change? What problem does it solve?

This PR proposes a way to optionally open external links to a new tab, and optionally mark external links with an icon.

Was the change discussed in an issue or in the Discussions before?

Closes #1612.

PR Checklist

  • [ ] This change adds/updates translations and I have used the template present here.
  • [x] I have enabled maintainer edits for this PR.
  • [x] I have verified that the code works as described/as intended.
  • [ ] This change adds a Social Icon which has a permissive license to use it.
  • [x] This change does not include any CDN resources/links.
  • [x] This change does not include any unrelated scripts such as bash and python scripts.
  • [x] This change updates the overridden internal templates from HUGO's repository.

Screenshots

Dark mode: Dark mode, Light mode: Light mode

David-Guillot avatar Oct 07 '24 08:10 David-Guillot

We already do this with external links in menu https://adityatelange.github.io/hugo-PaperMod/ image

adityatelange avatar Mar 01 '25 15:03 adityatelange

We already do this with external links in menu https://adityatelange.github.io/hugo-PaperMod/ image

Ah cool! So how do you feel about this PR? It brings two differences:

  • The icon is pure CSS, no SVG involved, so it's more lightweight and with better accessibility (screen readers won't try to read the image)
  • The ability to open external links in a new tab is added through a site-level option

Let me know if you think this should be implemented another way. Or if you think this implementation should be applied to what already exists in the header menu.

David-Guillot avatar Mar 01 '25 16:03 David-Guillot