1 | /* global hexo */
|
2 | ;
|
3 |
|
4 | const { extname } = require('path');
|
5 |
|
6 | const config = hexo.config.sitemap = Object.assign({
|
7 | path: 'sitemap.xml',
|
8 | rel: false
|
9 | }, hexo.config.sitemap);
|
10 |
|
11 | if (!extname(config.path)) {
|
12 | config.path += '.xml';
|
13 | }
|
14 |
|
15 | hexo.extend.generator.register('sitemap', require('./lib/generator'));
|
16 |
|
17 | if (config.rel === true) {
|
18 | hexo.extend.filter.register('after_render:html', require('./lib/rel'));
|
19 | }
|