1
0
mirror of synced 2026-01-09 06:03:09 -05:00

Merge pull request #21466 from github/repo-sync

repo sync
This commit is contained in:
Octomerger Bot
2022-10-18 14:24:11 -07:00
committed by GitHub
2 changed files with 17 additions and 26 deletions

View File

@@ -10,34 +10,27 @@ const cacheControl = cacheControlFactory(60 * 60 * 24)
// GitHub Support uses this for internal ZenDesk search functionality.
export default async function categoriesForSupport(req, res) {
const englishSiteTree = req.context.siteTree.en
const allCategories = []
await Promise.all(
Object.keys(englishSiteTree).map(async (version) => {
await Promise.all(
englishSiteTree[version].childPages.map(async (productPage) => {
if (productPage.page.relativePath.startsWith('early-access')) return
if (!productPage.childPages) return
await Promise.all(
productPage.childPages.map(async (categoryPage) => {
// We can't get the rendered titles from middleware/render-tree-titles
// here because that middleware only runs on the current version, and this
// middleware processes all versions.
const name = categoryPage.page.title.includes('{')
? await categoryPage.page.renderProp('title', req.context, renderOpts)
: categoryPage.page.title
for (const productPage of Object.values(englishSiteTree['free-pro-team@latest'].childPages)) {
if (productPage.page.relativePath.startsWith('early-access')) continue
if (!productPage.childPages || !productPage.childPages.length) continue
await Promise.all(
productPage.childPages.map(async (categoryPage) => {
// We can't get the rendered titles from middleware/render-tree-titles
// here because that middleware only runs on the current version, and this
// middleware processes all versions.
const name = categoryPage.page.title.includes('{')
? await categoryPage.page.renderProp('title', req.context, renderOpts)
: categoryPage.page.title
allCategories.push({
name,
published_articles: await findArticlesPerCategory(categoryPage, [], req.context),
})
})
)
allCategories.push({
name,
published_articles: await findArticlesPerCategory(categoryPage, [], req.context),
})
)
})
)
})
)
}
// Cache somewhat aggressively but note that it will be soft-purged
// in every prod deployment.

View File

@@ -12,8 +12,6 @@ import walkFiles from '../helpers/walk-files.js'
const allFiles = walkFiles('content', '.md')
.concat(walkFiles('data', ['.yml', '.md']))
// We need to update translations files directly so the new tests don't fail on them.
.concat(walkFiles('translations', ['.yml', '.md']))
// GraphQL content files have some non-FBV if statements that we don't want to change.
// Fortunately they do not include any FBV if statements, so we can just ignore the whole dir.
.filter((file) => !file.includes('/content/graphql/'))