diff --git a/themes/chameleon/scripts/sitemap/generator.js b/themes/chameleon/scripts/sitemap/generator.js index bb23f5d..a0b113a 100644 --- a/themes/chameleon/scripts/sitemap/generator.js +++ b/themes/chameleon/scripts/sitemap/generator.js @@ -2,7 +2,6 @@ const micromatch = require('micromatch') const template = require('./template') -const moment = require('moment') const isMatch = (path, patterns) => { if (patterns && patterns.length) { @@ -31,12 +30,6 @@ module.exports = function (locals) { .sort((a, b) => { return b.date - a.date }) - // https://github.com/pyyzcwg2833/hexo-generator-sitemap/commit/a92dbbb83cc39ff60d43faa5cd688a56574a3889 - .map((post) => ({ - ...post, - date: moment(post.date).format('YYYY-MM-DD[T00:00:00.000Z]'), - updated: post.updated ? moment(post.updated).format('YYYY-MM-DD[T00:00:00.000Z]') : false - })) // configuration dictionary const xmlConfig = { diff --git a/themes/chameleon/scripts/sitemap/template.js b/themes/chameleon/scripts/sitemap/template.js index 25a1370..213f39c 100644 --- a/themes/chameleon/scripts/sitemap/template.js +++ b/themes/chameleon/scripts/sitemap/template.js @@ -15,7 +15,6 @@ module.exports = function (config) { }) env.addFilter('formatDate', str => { - if (typeof str === 'string') return str.substring(0, 10) return moment(str).format('YYYY-MM-DD[T00:00:00.000Z]').substring(0, 10) })