dsifford / academic-bloggers-toolkit

WordPress plugin providing an all-in-one solution for effective academic blogging.
https://wordpress.org/plugins/academic-bloggers-toolkit/
GNU General Public License v3.0
120 stars 38 forks source link

Feature request: Option to add rel="nofollow" and target="_blank" tags for bibliography links. #560

Open jtwillia2 opened 5 years ago

jtwillia2 commented 5 years ago

Thanks for this awesome plugin! I'd like to request the option (or make it default behavior) to add the following to the outbound hyperlinks created in the bibliography:

  1. rel="nofollow" tag. Probably prudent to also add rel="noopener noreferrer".
  2. target="_blank" option to have links open in a new tab.
nerdyandawesome commented 5 years ago

Opening an external link on a new tab is a good convention to follow. Love this plugin, by the way!

askwpgirl commented 5 years ago

Thanks! My university client would also like the links to open in a new tab. The rel tag would be good as well. Love the plugin.

askwpgirl commented 5 years ago

In the meantime, you can use jQuery to open in new tab/window until plugin update:

`jQuery(document).ready(function($){

 $('.abt-bibliography a').click(function(){
    window.open(this.href);
    return false;
  });

});`

4faster commented 4 years ago

Hi... I have the same issue today, and try to find a quick solution.


I think that this issue is not on ABT side... ABT just pass the vendor data to our WordPress it is about vendor/citeproc.js --> I think it's from https://github.com/Juris-M/citeproc-js

if you want to manually change:

  1. you could open the vendor/citeproc.js
  2. CTRL-F, or search for "href"
  3. you will find 2 "href"(s), which are "the return" of "@URL/true" and "@DOI/true"
  4. for both of them, insert rel="nofollow" between <a and href so it will become... <a rel="nofollow" href="... you could add target="_blank" and "noreferrer noopener" if you want...
  5. save it.

then if you have some free time... :D

  1. open your post one by one, where ABT is used
  2. for each of your posts, click "refresh all item" from ABT menu...
  3. click update on your post..

However, I think is better to set it with <a rel="noreferrer noopener" target="_blank" href=..., because default WordPress link (if using "open in new tab") will add attributes like this.

And, please remember that you must re-check this file if ABT plugin is updated.

@dsifford, If you want to make it default, you could edit the vendor file before publishing it on the next version. :)