An open API service indexing awesome lists of open source software.

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

Add nofollow attribute to all external links automatically.
https://github.com/hexojs/hexo-filter-nofollow

hexo hexo-filter hexo-plugin nofollow seo

Last synced: 4 months ago
JSON representation

Add nofollow attribute to all external links automatically.

Awesome Lists containing this project

README

          

# hexo-filter-nofollow

[![npm version](https://badge.fury.io/js/hexo-filter-nofollow.svg)](https://www.npmjs.com/package/hexo-filter-nofollow)
[![npm license](https://img.shields.io/npm/l/hexo-filter-nofollow)](./LICENSE)
[![build status](https://img.shields.io/github/actions/workflow/status/hexojs/hexo-filter-nofollow/tester.yml?branch=master&label=test)](https://github.com/hexojs/hexo-filter-nofollow/actions?query=workflow%3ATester)
![npm download](https://img.shields.io/npm/dt/hexo-filter-nofollow)

Add nofollow attribute to all external links automatically.

`hexo-filter-nofollow` add `rel="noopener external nofollow noreferrer"` to all external links for security, privacy and SEO. [Read more](https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types).

## Installations

```bash
$ npm i hexo-filter-nofollow --save
```

## Options

```yaml
nofollow:
enable: true
field: site
exclude:
- 'exclude1.com'
- 'exclude2.com'
```

- **enable** - Enable the plugin. Default value is `true`.
- **field** - The scope you want the plugin to proceed, can be 'site' or 'post'. Default value is `site`.
- 'post' - Only add nofollow attribute to external links in your post content
- 'site' - Add nofollow attribute to external links of whole sites
- **exclude** - Exclude hostname. Specify subdomain when applicable, including `www`.
- 'exclude1.com' does not apply to `www.exclude1.com` nor `en.exclude1.com`.