Help us understand the problem. What is going on with this article?

HexoのRSSフィードプラグインを使ってみる

More than 5 years have passed since last update.

はじめに

こんにちは。インフラエンジニアレベル1のf_prgです。
Hexoの初期構築には右上にRSSフィードがあるですが、機能してませんでした。
プラグインでできるかなーとテキトーに考えて実装できたので、ご紹介します。

Hexoのプラグイン

ドキュメント

ドキュメントはコチラです。
https://github.com/hexojs/hexo/wiki/Plugins

アップデートする

インストールの前に、アップデートをします。

[18:30:48][f_prg@mba:blog]# npm update
npm http GET https://registry.npmjs.org/hexo-renderer-ejs/latest
npm http GET https://registry.npmjs.org/hexo-renderer-stylus/latest
npm http GET https://registry.npmjs.org/hexo-renderer-marked/latest
npm http 200 https://registry.npmjs.org/hexo-renderer-marked/latest
npm http GET https://registry.npmjs.org/hexo-renderer-marked
npm http 200 https://registry.npmjs.org/hexo-renderer-stylus/latest
npm http GET https://registry.npmjs.org/hexo-renderer-stylus
npm http 200 https://registry.npmjs.org/hexo-renderer-ejs/latest
npm http GET https://registry.npmjs.org/hexo-renderer-ejs
npm http 304 https://registry.npmjs.org/hexo-renderer-stylus
npm http GET https://registry.npmjs.org/nib/latest
npm http GET https://registry.npmjs.org/stylus/latest
npm http 304 https://registry.npmjs.org/hexo-renderer-marked
npm http GET https://registry.npmjs.org/marked/latest
npm http GET https://registry.npmjs.org/lodash/latest
npm http 200 https://registry.npmjs.org/nib/latest
npm http GET https://registry.npmjs.org/nib
npm http 200 https://registry.npmjs.org/stylus/latest
npm http GET https://registry.npmjs.org/stylus
npm http 200 https://registry.npmjs.org/marked/latest
npm http GET https://registry.npmjs.org/marked
npm http 200 https://registry.npmjs.org/lodash/latest
npm http GET https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/stylus
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/hexo-renderer-ejs
npm http GET https://registry.npmjs.org/ejs/latest
npm http 200 https://registry.npmjs.org/ejs/latest
npm http GET https://registry.npmjs.org/ejs
npm http 304 https://registry.npmjs.org/ejs
npm http 304 https://registry.npmjs.org/nib
npm http 304 https://registry.npmjs.org/marked
npm http GET https://registry.npmjs.org/stylus/0.44.0
npm http GET https://registry.npmjs.org/stylus/0.37.0
npm http 200 https://registry.npmjs.org/stylus/0.37.0
npm http 200 https://registry.npmjs.org/stylus/0.44.0
npm http GET https://registry.npmjs.org/stylus/-/stylus-0.37.0.tgz
npm http GET https://registry.npmjs.org/stylus/-/stylus-0.44.0.tgz
npm http 200 https://registry.npmjs.org/stylus/-/stylus-0.37.0.tgz
npm http 200 https://registry.npmjs.org/stylus/-/stylus-0.44.0.tgz
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/sax
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/sax
npm http GET https://registry.npmjs.org/css-parse
npm http GET https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/css-parse
npm http 304 https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/ms/0.6.2
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/ms/0.6.2
npm http 304 https://registry.npmjs.org/inherits
stylus@0.37.0 node_modules/hexo-renderer-stylus/node_modules/nib/node_modules/stylus
├── mkdirp@0.3.5
├── cssom@0.2.5
├── debug@1.0.4 (ms@0.6.2)
└── sax@0.5.8
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/sigmund
stylus@0.44.0 node_modules/hexo-renderer-stylus/node_modules/stylus
├── css-parse@1.7.0
├── mkdirp@0.3.5
├── debug@1.0.4 (ms@0.6.2)
├── sax@0.5.8
└── glob@3.2.11 (inherits@2.0.1, minimatch@0.3.0)

プラグインの追加

RSSフィード用のプラグインをインストールします。

[21:08:10][f_prg@mba:blog]# npm install hexo-generator-feed
npm http GET https://registry.npmjs.org/hexo-generator-feed
npm http 200 https://registry.npmjs.org/hexo-generator-feed
npm http GET https://registry.npmjs.org/hexo-generator-feed/-/hexo-generator-feed-0.2.0.tgz
npm http 200 https://registry.npmjs.org/hexo-generator-feed/-/hexo-generator-feed-0.2.0.tgz
npm http GET https://registry.npmjs.org/utils-merge
npm http GET https://registry.npmjs.org/ejs
npm http 200 https://registry.npmjs.org/utils-merge
npm http 304 https://registry.npmjs.org/ejs
hexo-generator-feed@0.2.0 node_modules/hexo-generator-feed
├── utils-merge@1.0.0
└── ejs@1.0.0

簡単ですね。

フィードの設定完了

http://localhost:4000/atom.xml
でフィードができるようになりました。

まとめ

初期状態のサイト上にあるので、最初から入ってると嬉しいですね。

参考資料・リンク

https://github.com/hexojs/hexo/wiki/Plugins

f_prg
WEB開発、アプリ開発デベロッパーです。 AWSのインフラ構築もできます。 https://www.slideshare.net/f_prg
https://blog.star-flare.com
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした