Adds rel nofollow to external links#4918
Conversation
Fixes #4583 Signed-off-by: Franck Nijhof <frenck@geekchimp.com>
| dom.css('a').each do |link| | ||
|
|
||
| # All external links start with 'http', skip when this one does not | ||
| next unless link.get_attribute('href') =~ /\Ahttp/i |
There was a problem hiding this comment.
This assumption is not correct. For the release notes I use absolute urls because I copy paste same notes between GitHub and our site.
There was a problem hiding this comment.
nevermind, just saw the home assistant check a few lines below
| next unless link.get_attribute('href') =~ /\Ahttp/i | ||
|
|
||
| # Play nice with links that already have a rel attribute set, skip it | ||
| next if link.get_attribute('rel') |
There was a problem hiding this comment.
I don't know about this, that means one can cheat our system
There was a problem hiding this comment.
Another take: It allows for exceptions and keeps the documented Jekyll behavior as is.
(Lets put everybody in prison to prevent crimes... 😉)
There was a problem hiding this comment.
Can we just append ' external nofollow` if it exists?
|
Latest change seems to add a lot of build time, need to investigate a little more. Adding WIP status. |
|
I'm not surprised if it takes longer, it has to parse all HTML -> DOM and back |
|
It actually wasn't that bad... ~500 sec for the full site generation (including the dom parsing and the installation/compilation of Nokogiri). After the last change, it seems impacted a lot. |
* ✨ Adds rel nofollow to external links Fixes home-assistant#4583 Signed-off-by: Franck Nijhof <frenck@geekchimp.com> * 🎀 Adds support for appending nofollow to existing external links
Description:
Adds
rel="external nofollow"to all external links on the website.Fixes #4583
Pull request in home-assistant (if applicable): N/A
Checklist:
current. New documentation for platforms/components and features should go tonext.