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

20 lines
386 B
JavaScript
Raw Permalink Normal View History

2024-09-28 06:31:52 +00:00
'use strict'
/* global hexo */
/*
* 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({
path: 'sitemap.xml'
}, hexo.config.sitemap)
if (!pathFn.extname(config.path)) {
config.path += '.xml'
}
hexo.extend.generator.register('sitemap', require('./generator'))