2019-08-12 11:02:22 +00:00
|
|
|
/* global hexo */
|
|
|
|
'use strict'
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Modified from the hexo version,
|
|
|
|
* https://github.com/hexojs/hexo-generator-feed
|
2020-06-23 04:27:55 +00:00
|
|
|
* to remove timezone
|
2019-08-12 11:02:22 +00:00
|
|
|
*/
|
|
|
|
|
2019-10-17 09:28:40 +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
|
2019-10-17 09:28:40 +00:00
|
|
|
if (!extname(config.path)) {
|
2019-08-12 11:02:22 +00:00
|
|
|
config.path += '.xml'
|
|
|
|
}
|
|
|
|
|
|
|
|
hexo.extend.generator.register('feed', require('./generator'))
|