build(docs-infra): ensure hidden cli commands are excluded from sitemap.xml (#30395)
				
					
				
			Previously, the processor that excludes certain cli commands (`filterHiddenCommand`) was being run after the `createSitemap` processor, resulting in those commands to be present in `sitemap.xml`, while the actual pages where missing. This also resulted in 404s, when search engine crawlers tried to index the missing URLs. This commit fixes it by ensuring that the `filterHiddenCommand` processor is run before the `createSitemap` processor. PR Close #30395
This commit is contained in:
		
							parent
							
								
									44cf981407
								
							
						
					
					
						commit
						d80ae6ba0d
					
				| @ -1,7 +1,7 @@ | |||||||
| module.exports = function filterHiddenCommands() { | module.exports = function filterHiddenCommands() { | ||||||
|   return { |   return { | ||||||
|     $runAfter: ['files-read'], |     $runAfter: ['files-read'], | ||||||
|     $runBefore: ['processCliContainerDoc'], |     $runBefore: ['processCliContainerDoc', 'createSitemap'], | ||||||
|     $process(docs) { |     $process(docs) { | ||||||
|       return docs.filter(doc => doc.docType !== 'cli-command' || doc.hidden !== true); |       return docs.filter(doc => doc.docType !== 'cli-command' || doc.hidden !== true); | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -18,7 +18,7 @@ describe('filterHiddenCommands processor', () => { | |||||||
| 
 | 
 | ||||||
|   it('should run before the correct processor', () => { |   it('should run before the correct processor', () => { | ||||||
|     const processor = processorFactory(); |     const processor = processorFactory(); | ||||||
|     expect(processor.$runBefore).toEqual(['processCliContainerDoc']); |     expect(processor.$runBefore).toEqual(['processCliContainerDoc', 'createSitemap']); | ||||||
|   }); |   }); | ||||||
| 
 | 
 | ||||||
|   it('should remove CLI command docs that are hidden', () => { |   it('should remove CLI command docs that are hidden', () => { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user