2019-06-04 03:38:09 +00:00
|
|
|
'use strict'
|
|
|
|
/* global hexo */
|
|
|
|
|
2019-05-27 02:08:57 +00:00
|
|
|
/*
|
|
|
|
* Add sitemap.xml
|
|
|
|
* Based on https://github.com/hexojs/hexo-generator-sitemap/pull/26
|
|
|
|
*/
|
|
|
|
|
|
|
|
const pathFn = require('path')
|
|
|
|
|
|
|
|
const config = hexo.config.sitemap = Object.assign({
|
2020-07-01 06:52:00 +00:00
|
|
|
path: 'sitemap.xml'
|
2019-05-27 02:08:57 +00:00
|
|
|
}, hexo.config.sitemap)
|
|
|
|
|
|
|
|
if (!pathFn.extname(config.path)) {
|
|
|
|
config.path += '.xml'
|
|
|
|
}
|
|
|
|
|
|
|
|
hexo.extend.generator.register('sitemap', require('./generator'))
|