tech-radar
tech-radar copied to clipboard
Cleanup/enhancenments to links
This changes a few things about links:
- Links are now always enabled for blips Previously, it was only enabled for blips if there is no legend (config.print_layout = true)
- hrefs are only added if there is actually a link Previously, there were always href created--if there was no link, the href was #. This caused a page refresh and a blink of the tech radar.
- Use xlink:href everywhere Previously, blips used xlink:href, but text still used href. xlink:href has actually been deprecated, but currently still has better cross-platform support.
- Links can now open in new tabs Previously, links always opened in the existing tab. This adds a new config: links_in_new_tabs. Setting that to true will add a target="_blank" for all hrefs, causing the link to be opened in a new tab. Setting config.links_in_new_tabs to false or not including it at all retains the old behavior.
Thanks, @cmreigrut , for the very helpful changes.
Why not merged?
@cmreigrut thanks for your contribution and patience. I accepted changes 1,3,4 and incorporated links_in_new_tabs: true
as default behavior (incl. README).
I reverted change 2 (dropping the href="#"
target), because as implemented currently empty <a>
tags negatively affect the SEO score of the resulting page. The code would need to be adjusted to skip the <a>
tag in case links are missing. Feel free to send another PR if you're up for it. I can't reproduce the page refresh/blink behavior that you mentioned in Chrome/Safari.
I'm closing this PR in favor of #103.