注意事項

本文書は、本人が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を確保します。阅读更多。

インストール

$ npm i hexo-filter-nofollow --save

設定

nofollow:
  enable: true
  field: site
  exclude:
    - "exclude1.com"
    - "exclude2.com"
  • enable - プラグインを有効化します。デフォルト値はtrueです
  • field - プラグインが属性を追加する範囲をsiteまたはpostで指定します。デフォルト値はsiteです
    • post - 記事本文内の外部リンクにのみ nofollow 属性を追加します
    • site - サイト全体の外部リンクに nofollow 属性を追加します
  • exclude - ホスト名を除外します。該当する場合はサブドメインを指定します(wwwを含む)
    • exclude1.comはwww.exclude1.comまたはen.exclude1.comには適用されません