Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hostname white list to skip adding rel attributes #10

Closed
nickjj opened this issue Oct 11, 2019 · 3 comments
Closed

Add hostname white list to skip adding rel attributes #10

nickjj opened this issue Oct 11, 2019 · 3 comments

Comments

@nickjj
Copy link

nickjj commented Oct 11, 2019

Hi,

The behavior I'm seeking is:

  • All external links open in a new window
  • All external links get noopner and noreferrer
  • An optional white list of hostnames can be added which don't get the rel nofollow attributes (even if set)

Use case:

I'm going to be adding a site where 95% of the links are external and 5% of the links are trusted so I don't want to set nofollow.

Potential API for usage:

target-blank:
  rel_nofollow_skip_domains: ["example.com", "github.com"]

Example link output:

<a href="http://example.com" target="_blank">Example</a>
<a href="https://example.com" target="_blank">Example</a>
<a href="https://www.example.com" target="_blank">Example</a>
<a href="http://foo.github.com" target="_blank">GitHub</a>
<a href="https://www.github.com" target="_blank">GitHub</a>
<a href="https://foo.bar.github.com" target="_blank">GitHub</a>
<a href="https://somewhere.com" target="_blank" rel="nofollow">Somewhere</a>
@kenchan0130
Copy link
Owner

@nickjj
Thank you for your contribution.
Looks good.

Since the head family seems to have started maintenance, I'm proposing whether it can be merged there.
keithmifsud#35 (comment)

Sorry for stopping the discussion.

@kenchan0130
Copy link
Owner

Hi @nickjj,
Since the maintainer of the head family has returned, I will close and move this issue.

@nickjj
Copy link
Author

nickjj commented Oct 15, 2019

Thanks. In the end I found https://github.com/d-ogarkov/jekyll-extlinks which did the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants