Notice

This document was translated by me from the official documentation 机翻hexo-filter-nofollow and is kept here purely as a record.

hexo-filter-nofollow official documentation: https://github.com/hexojs/hexo-filter-nofollow

hexo-filter-nofollow

Add rel="noopener external nofollow noreferrer" to every external link used on your site, which effectively strengthens SEO and prevents link equity from leaking away.

Automatically adds the nofollow attribute to all external links.

hexo-filter-nofollow adds rel="noopener external nofollow noreferrer" to all external links for security, privacy and SEO. 阅读更多.

Installation

$ npm i hexo-filter-nofollow --save

Configuration

nofollow:
  enable: true
  field: site
  exclude:
    - "exclude1.com"
    - "exclude2.com"
  • enable - Enables the plugin. The default value is true
  • field - Whether you want the plugin to apply to site or post. The default value is site
    • post - Adds the nofollow attribute only to external links in post content
    • site - Adds the nofollow attribute to external links across the whole site
  • exclude - Excludes hostnames. Specify the subdomain where applicable, including www
    • exclude1.com does not apply to www.exclude1.com or en.exclude1.com