笔记:Hexo相关

由于一些不确定因素太多,以防后期再次折腾Hexo,特在此留下笔记,以备不时之需。

添加订阅(RSS?)

到官方的插件站以关键词rss搜索,其中的hexo-generator-feed即可满足需求。按其介绍,通过以下命令完成安装:

1
npm install hexo-generator-feed --save

完成安装后,在node_modules路径下多出个hexo-generator-feed文件夹,即表示安装成功。再到hexo的配置文件中设置插件。打开_config.yml,在 #extensions注释处编辑本扩展的选项。选项包括以下内容:

1
2
3
4
5
6
7
8
feed:
type: atom
path: atom.xml
limit: 20
hub:
content:
content_limit: 140
content_limit_delim: ' '

各选项的意义见下面(懒得翻译了~):

type - Feed type. (atom/rss2)
path - Feed path. (Default: atom.xml/rss2.xml)
limit - Maximum number of posts in the feed (Use 0 or false to show all posts)
hub - URL of the PubSubHubbub hubs (Leave it empty if you don’t use it)
content - (optional) set to ‘true’ to include the contents of the entire post in the feed.
content_limit - (optional) Default length of post content used in summary. Only used, if content setting is false and no custom post description present.
content_limit_delim - (optional) If content_limit is used to shorten post contents, only cut at the last occurrence of this delimiter before reaching the character limit. Not used by default.