Skip to content

Revert "Repo sync" #26296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
babelOptions: { configFile: './.babelrc' },
sourceType: 'module',
},
ignorePatterns: ['tmp/*', '!/.*', '/.next/', 'script/bookmarklets/*', 'rest-api-description/'],
ignorePatterns: ['tmp/*', '!/.*', '/.next/', 'script/bookmarklets/*'],
rules: {
'import/no-extraneous-dependencies': ['error', { packageDir: '.' }],
},
Expand Down
File renamed without changes.
15 changes: 0 additions & 15 deletions content/rest/billing/index.md

This file was deleted.

20 changes: 0 additions & 20 deletions content/rest/code-scanning/index.md

This file was deleted.

18 changes: 0 additions & 18 deletions content/rest/codes-of-conduct/index.md

This file was deleted.

File renamed without changes.
17 changes: 0 additions & 17 deletions content/rest/deploy-keys/index.md

This file was deleted.

File renamed without changes.
20 changes: 0 additions & 20 deletions content/rest/emojis/index.md

This file was deleted.

File renamed without changes.
18 changes: 0 additions & 18 deletions content/rest/gitignore/index.md

This file was deleted.

File renamed without changes.
18 changes: 0 additions & 18 deletions content/rest/licenses/index.md

This file was deleted.

File renamed without changes.
18 changes: 0 additions & 18 deletions content/rest/markdown/index.md

This file was deleted.

File renamed without changes.
21 changes: 0 additions & 21 deletions content/rest/meta/index.md

This file was deleted.

13 changes: 0 additions & 13 deletions content/rest/oauth-authorizations/index.md

This file was deleted.

File renamed without changes.
17 changes: 0 additions & 17 deletions content/rest/packages/index.md

This file was deleted.

File renamed without changes.
20 changes: 0 additions & 20 deletions content/rest/pages/index.md

This file was deleted.

File renamed without changes.
16 changes: 0 additions & 16 deletions content/rest/rate-limit/index.md

This file was deleted.

File renamed without changes.
18 changes: 0 additions & 18 deletions content/rest/reactions/index.md

This file was deleted.

File renamed without changes.
15 changes: 0 additions & 15 deletions content/rest/scim/index.md

This file was deleted.

File renamed without changes.
18 changes: 0 additions & 18 deletions content/rest/search/index.md

This file was deleted.

16 changes: 0 additions & 16 deletions content/rest/secret-scanning/index.md

This file was deleted.

27 changes: 25 additions & 2 deletions src/rest/scripts/utils/update-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,31 @@ async function getDataFrontmatter(dataDirectory, schemaFilename) {
async function getMarkdownContent(versions) {
const markdownUpdates = {}

for (const [category, subcategoryObject] of Object.entries(versions)) {
const subcategories = Object.keys(subcategoryObject)
for (const category of Object.keys(versions)) {
const subcategories = Object.keys(versions[category])
// When there is only a single subcategory and the name
// matches the category, this is an override due to a
// subcategory not being defined. In this case,
// the markdown file will be in the content/rest directory.
// The file path will be content/rest/<category>.md
if (subcategories.length === 1 && category === subcategories[0]) {
// this will be a file in the root of the rest directory
const filepath = path.join('content/rest', `${category}.md`)
markdownUpdates[filepath] = {
data: {
title: category,
shortTitle: category,
intro: '',
versions: await convertVersionsToFrontmatter(
versions[category][subcategories[0]].versions
),
...frontmatterDefaults,
},
content: '',
}
continue
}

// The file path will be content/rest/<category>/<subcategory>.md
for (const subcategory of subcategories) {
const filepath = path.join('content/rest', category, `${subcategory}.md`)
Expand Down
Loading