声明

本文档由本人机翻hexo-filter-nofollow的官方文档,仅用于记录

hexo-filter-nofollow 官方文档:https://github.com/hexojs/hexo-filter-nofollow

hexo-filter-nofollow

为网站使用到的所有外链添加rel="noopener external nofollow noreferrer", 可以有效地加强网站 SEO 和防止权重流失

自动为所有外部链接添加 nofollow 属性。

hexo-filter-nofollow 将 rel=“noopener external nofollow noreferrer” 添加到所有外部链接以确保安全、隐私和 SEO。阅读更多

安装

1
$ npm i hexo-filter-nofollow --save

配置

1
2
3
4
5
6
nofollow:
enable: true
field: site
exclude:
- "exclude1.com"
- "exclude2.com"
  • enable - 启用插件。默认值为true
  • field - 您希望插件添加的范围是sitepost。 默认值为site
    • post - 仅将 nofollow 属性添加到帖子内容中的外部链接
    • site - 全站外链添加 nofollow 属性
  • exclude - 排除主机名。在适用时指定子域,包括www
    • exclude1.com不适用于www.exclude1.comen.exclude1.com