2.0.0 • Published 5 years ago

hexo-nofollow v2.0.0

Weekly downloads
972
License
MIT
Repository
github
Last release
5 years ago

hexo-nofollow

npm version Build Status

Adds nofollow attribute to all external links in your hexo blog posts automatically.

This is an updated version of hexo-autonofollow. All the options are the same, so you can use this as a drop-in replacement.

Features

  • Add rel="external nofollow noopener noreferrer" to all external links for security, privacy and SEO. Read more.
  • Add target="_blank", Open external links in new window or tab. This can be disabled, see below.

Hexo doesn't insert target="_blank" to all external links even if you set external_link: true (default value) in the _config.yml. This plugin make sure all external links are processed.

For example,

[example-link](https://example.com)

Becomes,

<a href="https://example.com" rel="external nofollow noopener noreferrer" target="_blank">example-link</a>

Install

$ npm install hexo-nofollow --save

Usage

To enable this plugin, insert the following to _config.yml:

nofollow:
  enable: true

To exclude certain links, see below.

Options

nofollow:
  enable: true
  exclude:
    - 'exclude1.com'
    - 'exclude2.com'
external_link: true
  • enable - Enable the plugin. Defaults to false.
  • exclude - Exclude hostname. Specify subdomain when applicable, including www
    • 'exclude1.com' does not apply to www.exclude1.com nor en.exclude1.com.
  • external_link - Add target="_blank". Defaults to true. Recommend to set it to false.

Note: external_link setting is already in the default _config.yml.

Credits

All credits go to the following work:

2.0.0

5 years ago

2.0.0-alpha.3

5 years ago

1.0.11

5 years ago

2.0.0-alpha.2

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.0

6 years ago