使用 node-rss 生成 RSS XML:
exports.feed = function* () {
var feed = new rss({
title: "陈佳人",
description: "人生是一场独自修行的道路",
feed_url: "http://renjm.com/feed",
site_url: "http://renjm.com",
});
var blogs = yield blogDB.getBlogs();
blogs.forEach(function (v) {
feed.item({
title: v.title,
description: v.realContent,
url: "http://renjm.com/blog/" + v.id,
date: v.addTime,
});
});
this.body = feed.xml();
this.type = "text/xml";
};