refactor(docs-infra): rename properties (blacklisted --> ignored) (#29754)
PR Close #29754
This commit is contained in:
parent
c5bba8d9f2
commit
8bbf481d60
|
@ -1,12 +1,12 @@
|
||||||
module.exports = function createSitemap() {
|
module.exports = function createSitemap() {
|
||||||
return {
|
return {
|
||||||
blacklistedDocTypes: [
|
ignoredDocTypes: [
|
||||||
'announcements-json',
|
'announcements-json',
|
||||||
'contributors-json',
|
'contributors-json',
|
||||||
'navigation-json',
|
'navigation-json',
|
||||||
'resources-json',
|
'resources-json',
|
||||||
],
|
],
|
||||||
blacklistedPaths: [
|
ignoredPaths: [
|
||||||
'file-not-found',
|
'file-not-found',
|
||||||
'overview-dump',
|
'overview-dump',
|
||||||
'test',
|
'test',
|
||||||
|
@ -23,8 +23,8 @@ module.exports = function createSitemap() {
|
||||||
// Filter out docs that are not outputted
|
// Filter out docs that are not outputted
|
||||||
.filter(doc => doc.outputPath)
|
.filter(doc => doc.outputPath)
|
||||||
// Filter out unwanted docs
|
// Filter out unwanted docs
|
||||||
.filter(doc => this.blacklistedDocTypes.indexOf(doc.docType) === -1)
|
.filter(doc => this.ignoredDocTypes.indexOf(doc.docType) === -1)
|
||||||
.filter(doc => this.blacklistedPaths.indexOf(doc.path) === -1)
|
.filter(doc => this.ignoredPaths.indexOf(doc.path) === -1)
|
||||||
// Capture the path of each doc
|
// Capture the path of each doc
|
||||||
.map(doc => doc.path)
|
.map(doc => doc.path)
|
||||||
// Convert the homepage: `index` to `/`
|
// Convert the homepage: `index` to `/`
|
||||||
|
|
|
@ -53,7 +53,7 @@ describe('createSitemap processor', () => {
|
||||||
{ path: 'cde', outputPath: 'cde', docType: 'bad' },
|
{ path: 'cde', outputPath: 'cde', docType: 'bad' },
|
||||||
{ path: 'fgh', outputPath: 'fgh', docType: 'good' },
|
{ path: 'fgh', outputPath: 'fgh', docType: 'good' },
|
||||||
];
|
];
|
||||||
processor.blacklistedDocTypes = ['bad'];
|
processor.ignoredDocTypes = ['bad'];
|
||||||
processor.$process(docs);
|
processor.$process(docs);
|
||||||
expect(docs.pop().urls).toEqual(['abc', 'fgh']);
|
expect(docs.pop().urls).toEqual(['abc', 'fgh']);
|
||||||
});
|
});
|
||||||
|
@ -64,7 +64,7 @@ describe('createSitemap processor', () => {
|
||||||
{ path: 'cde', outputPath: 'cde' },
|
{ path: 'cde', outputPath: 'cde' },
|
||||||
{ path: 'fgh', outputPath: 'fgh' },
|
{ path: 'fgh', outputPath: 'fgh' },
|
||||||
];
|
];
|
||||||
processor.blacklistedPaths = ['cde'];
|
processor.ignoredPaths = ['cde'];
|
||||||
processor.$process(docs);
|
processor.$process(docs);
|
||||||
expect(docs.pop().urls).toEqual(['abc', 'fgh']);
|
expect(docs.pop().urls).toEqual(['abc', 'fgh']);
|
||||||
});
|
});
|
||||||
|
@ -80,4 +80,4 @@ describe('createSitemap processor', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue