зеркало из https://github.com/github/docs.git
Fix some typos in the lib directory (#17131)
Co-authored-by: Chiedo John <2156688+chiedo@users.noreply.github.com>
This commit is contained in:
Родитель
dc36539478
Коммит
4e781a553c
|
@ -1,6 +1,6 @@
|
|||
// This module takes cheerio page object and divides it into sections
|
||||
// using H1,h2,h3 heading elements as section delimiters. The text
|
||||
// that follows each heading becomes the content of the searh record.
|
||||
// that follows each heading becomes the content of the search record.
|
||||
|
||||
const { chain } = require('lodash')
|
||||
const urlPrefix = 'https://docs.github.com'
|
||||
|
|
|
@ -46,7 +46,7 @@ module.exports = async function syncAlgoliaIndices (opts = {}) {
|
|||
|
||||
console.log(`Building indices for ${opts.language || 'all languages'} and ${opts.version || 'all versions'}.\n`)
|
||||
|
||||
// Exlude WIP pages, hidden pages, index pages, etc
|
||||
// Exclude WIP pages, hidden pages, index pages, etc
|
||||
const indexablePages = await findIndexablePages()
|
||||
|
||||
// Build and validate all indices
|
||||
|
|
|
@ -20,7 +20,7 @@ function getApplicableVersions (frontmatterVersions, filepath) {
|
|||
// enterprise-server: '>=2.19'
|
||||
// enterprise-cloud: '*'
|
||||
// private-instances: '*'
|
||||
// ^ where each key correponds to a plan
|
||||
// ^ where each key corresponds to a plan
|
||||
Object.entries(frontmatterVersions)
|
||||
.forEach(([plan, planValue]) => {
|
||||
// for each plan (e.g., enterprise-server), get matching versions from allVersions object
|
||||
|
|
|
@ -57,7 +57,7 @@ class Page {
|
|||
this.raw = this.raw.replace(': verdadero', ': true')
|
||||
}
|
||||
|
||||
// parse fronmatter and save any errors for validation in the test suite
|
||||
// parse frontmatter and save any errors for validation in the test suite
|
||||
const { content, data, errors: frontmatterErrors } = frontmatter(this.raw, { filepath: this.fullPath })
|
||||
this.frontmatterErrors = frontmatterErrors
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ module.exports = function getOldPathsFromPath (currentPath, languageCode, curren
|
|||
.replace(`/enterprise/${latest}`, '/enterprise'))
|
||||
|
||||
// create old path /enterprise/foo from current path /enterprise/user/foo
|
||||
// this supports old developer paths like /enteprise/webhooks with no /user in them
|
||||
// this supports old developer paths like /enterprise/webhooks with no /user in them
|
||||
if (currentPath.includes('/enterprise/')) {
|
||||
oldPaths.add(currentPath
|
||||
.replace('/user/', '/'))
|
||||
|
|
|
@ -48,7 +48,7 @@ module.exports = function generateRedirectsForPermalinks (permalinks, redirectFr
|
|||
})
|
||||
})
|
||||
|
||||
// filter for uniqe entries only
|
||||
// filter for unique entries only
|
||||
Object.entries(redirects).forEach(([oldPath, newPath]) => {
|
||||
if (oldPath === newPath) delete redirects[oldPath]
|
||||
})
|
||||
|
|
|
@ -61,7 +61,7 @@ module.exports = function precompileRedirects (pageList, pageMap) {
|
|||
}
|
||||
|
||||
// given a developer route like `/enterprise/2.19/v3/activity`,
|
||||
// add a veriation like `/enterprise/2.19/user/v3/activity`;
|
||||
// add a variation like `/enterprise/2.19/user/v3/activity`;
|
||||
// we need to do this because all links in content get rewritten
|
||||
// by lib/rewrite-local-links to include `/user`
|
||||
if (developerRoute.includes('/enterprise/')) {
|
||||
|
@ -72,7 +72,7 @@ module.exports = function precompileRedirects (pageList, pageMap) {
|
|||
}
|
||||
|
||||
// given a developer route like `/v3/gists/comments`,
|
||||
// add a veriation like `/free-pro-team@latest/v3/gists/comments`;
|
||||
// add a variation like `/free-pro-team@latest/v3/gists/comments`;
|
||||
// again, we need to do this because all links in content get rewritten
|
||||
if (!developerRoute.startsWith('/enterprise/')) {
|
||||
const developerRouteWithVersion = slash(path.join(nonEnterpriseDefaultVersion, developerRoute))
|
||||
|
|
Загрузка…
Ссылка в новой задаче