angular-docs-cn/aio/tools/transforms/angular-base-package/processors/createSitemap.js

16 lines
395 B
JavaScript
Raw Normal View History

module.exports = function createSitemap() {
return {
$runAfter: ['paths-computed'],
$runBefore: ['rendering-docs'],
$process(docs) {
docs.push({
id: 'sitemap.xml',
path: 'sitemap.xml',
outputPath: '../sitemap.xml',
template: 'sitemap.template.xml',
urls: docs.filter(doc => doc.outputPath).map(doc => doc.path)
});
}
};
};