1
0
mirror of synced 2025-12-21 19:06:49 -05:00

Block indexing not crawling (#17044)

* Block indexing instead of crawling

* Lint

* Update deprecated-enterprise-versions.js

* Combine loops
This commit is contained in:
Kevin Heis
2020-12-17 11:57:18 -08:00
committed by GitHub
parent d507eec2e8
commit c62f49aa0e
8 changed files with 162 additions and 127 deletions

View File

@@ -1,33 +1,4 @@
const languages = require('../lib/languages')
const products = require('../lib/all-products')
const { deprecated } = require('../lib/enterprise-server-releases.js')
let defaultResponse = 'User-agent: *'
// Disallow crawling of WIP localized content
Object.values(languages)
.filter(language => language.wip)
.forEach(language => {
defaultResponse = defaultResponse.concat(`\nDisallow: /${language.code}\nDisallow: /${language.code}/*\n`)
})
// Disallow crawling of WIP products
Object.values(products)
.filter(product => product.wip || product.hidden)
.forEach(product => {
defaultResponse = defaultResponse.concat(`\nDisallow: /*${product.href}`)
product.versions.forEach(version => {
defaultResponse = defaultResponse.concat(`\nDisallow: /*${version}/${product.id}`)
})
})
// Disallow crawling of Deprecated enterprise versions
deprecated
.forEach(version => {
defaultResponse = defaultResponse
.concat(`\nDisallow: /*/enterprise-server@${version}/*`)
.concat(`\nDisallow: /*/enterprise/${version}/*`)
})
const defaultResponse = 'User-agent: *'
const disallowAll = `User-agent: *
Disallow: /`