blog/themes/chameleon/scripts/feed/index.js

33 lines
617 B
JavaScript
Raw Normal View History

2019-08-12 11:02:22 +00:00
/* global hexo */
'use strict'
/*
* Modified from the hexo version,
* https://github.com/hexojs/hexo-generator-feed
* to remove timezone
2019-08-12 11:02:22 +00:00
*/
const { extname } = require('path')
2019-08-12 11:02:22 +00:00
const config = hexo.config.feed = Object.assign({
type: 'atom',
limit: 20,
hub: '',
content: true,
content_limit: 140,
content_limit_delim: '',
order_by: '-date'
}, hexo.config.feed)
// Set default feed path
if (!config.path) {
config.path = config.type + '.xml'
}
// Add extension name if don't have
if (!extname(config.path)) {
2019-08-12 11:02:22 +00:00
config.path += '.xml'
}
hexo.extend.generator.register('feed', require('./generator'))