Skip to content
Merged
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 content/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ journeyTracks:
- Optional.

### `topics`
- Purpose: Indicate the topics covered by the article. Refer to the content models for more details about adding topics. A full list of existing topics is located in the [allowed topics file](/data/allowed-topics.js). If topics in article frontmatter and the allow-topics list become out of sync, the [topics CI test](/src/search/tests/topics.js) will fail.
- Purpose: Indicate the topics covered by the article. Refer to the content models for more details about adding topics. A full list of existing topics is located in the [allowed topics file](/data/allowed-topics.ts). If topics in article frontmatter and the allow-topics list become out of sync, the [topics CI test](/src/search/tests/topics.ts) will fail.
- Type: Array of `String`s
- Optional: Topics are preferred for each article, but, there may be cases where existing articles don't yet have topics, or adding a topic to a new article may not add value.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ topics:
---
```

For more information on adding topics to an article see, [AUTOTITLE](/contributing/writing-for-github-docs/using-yaml-frontmatter#topics). For a list of all allowed topics, see [`allowed-topics`](https://github.com/github/docs/blob/main/data/allowed-topics.js).
For more information on adding topics to an article see, [AUTOTITLE](/contributing/writing-for-github-docs/using-yaml-frontmatter#topics). For a list of all allowed topics, see [`allowed-topics`](https://github.com/github/docs/blob/main/data/allowed-topics.ts).

## Topics for all content types

Expand Down
10 changes: 5 additions & 5 deletions content/contributing/writing-for-github-docs/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ intro: 'Article intro. See tips for a great intro below.'
product: "{{ optional product callout }}"
type: reference
topics:
- <topic> # One or more from list of allowed topics: https://github.com/github/docs/blob/main/data/allowed-topics.js
- <topic> # One or more from list of allowed topics: https://github.com/github/docs/blob/main/data/allowed-topics.ts
versions:
- <version>
---
Expand Down Expand Up @@ -125,7 +125,7 @@ intro: 'Article intro. See tips for a great intro below.'
product: "{{ optional product callout }}"
type: how_to
topics:
- <topic> # One or more from list of allowed topics: https://github.com/github/docs/blob/main/data/allowed-topics.js
- <topic> # One or more from list of allowed topics: https://github.com/github/docs/blob/main/data/allowed-topics.ts
versions:
- <version>
---
Expand Down Expand Up @@ -176,7 +176,7 @@ shortTitle: <subject> # Max 31 characters
intro: 'Article intro. Highlight that the guide is quick and to the point.'
type: quick_start
topics:
- <topic> # One or more from list of allowed topics: https://github.com/github/docs/blob/main/data/allowed-topics.js
- <topic> # One or more from list of allowed topics: https://github.com/github/docs/blob/main/data/allowed-topics.ts
versions:
- <version>
---
Expand Down Expand Up @@ -245,7 +245,7 @@ intro: 'Article intro. See tips for a great intro below'
product: "{{ optional product callout }}"
type: tutorial
topics:
- <topic> # One or more from list of allowed topics: https://github.com/github/docs/blob/main/data/allowed-topics.js
- <topic> # One or more from list of allowed topics: https://github.com/github/docs/blob/main/data/allowed-topics.ts
versions:
- <version>
---
Expand Down Expand Up @@ -320,7 +320,7 @@ intro: 'Article intro. See tips for a great intro below'
product: "{{ optional product callout }}"
type: tutorial
topics:
- <topic> # One or more from list of allowed topics: https://github.com/github/docs/blob/main/data/allowed-topics.js
- <topic> # One or more from list of allowed topics: https://github.com/github/docs/blob/main/data/allowed-topics.ts
versions:
- <version>
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ journeyTracks:

### `topics`

* Purpose: Indicate the topics covered by the article. Refer to the content models for more details about adding topics. A full list of existing topics is located in the [allowed topics file](https://github.com/github/docs/blob/main/data/allowed-topics.js). If topics in article frontmatter and the allow-topics list become out of sync, the [topics CI test](https://github.com/github/docs/blob/main/src/search/tests/topics.ts) will fail.
* Purpose: Indicate the topics covered by the article. Refer to the content models for more details about adding topics. A full list of existing topics is located in the [allowed topics file](https://github.com/github/docs/blob/main/data/allowed-topics.ts). If topics in article frontmatter and the allow-topics list become out of sync, the [topics CI test](https://github.com/github/docs/blob/main/src/search/tests/topics.ts) will fail.
* Type: Array of `String`s
* Optional: Topics are preferred for each article, but, there may be cases where existing articles don't yet have topics, or adding a topic to a new article may not add value.

Expand Down
21 changes: 13 additions & 8 deletions content/copilot/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,21 @@ introLinks:
featuredLinks:
startHere:
- /copilot/get-started/what-is-github-copilot
- /copilot/get-started/quickstart
- /copilot/tutorials/try-extensions
- /copilot/concepts/agents/coding-agent
- '{% ifversion fpt %}/copilot/get-started/quickstart{% endif %}'
- '{% ifversion fpt %}/copilot/tutorials/try-extensions{% endif %}'
- '{% ifversion fpt %}/copilot/concepts/agents/coding-agent{% endif %}'
- '{% ifversion ghec %}/copilot/get-started/choose-enterprise-plan{% endif %}'
- '{% ifversion ghec %}/copilot/how-tos/set-up/set-up-for-enterprise{% endif %}'
- '{% ifversion ghec %}/copilot/tutorials/coding-agent/pilot-coding-agent{% endif %}'
popular:
- /copilot/get-started/features
- /copilot/tutorials/copilot-chat-cookbook
- /copilot/how-tos/get-code-suggestions/get-ide-code-suggestions
- /copilot/how-tos/chat-with-copilot/chat-in-ide
- /copilot/how-tos/use-copilot-for-common-tasks/use-copilot-in-the-cli
- '{% ifversion fpt %}/copilot/tutorials/copilot-chat-cookbook{% endif %}'
- '{% ifversion fpt %}/copilot/how-tos/get-code-suggestions/get-ide-code-suggestions{% endif %}'
- '{% ifversion fpt %}/copilot/how-tos/chat-with-copilot/chat-in-ide{% endif %}'
- '{% ifversion fpt %}/copilot/how-tos/use-copilot-for-common-tasks/use-copilot-in-the-cli{% endif %}'
- '{% ifversion ghec %}/copilot/how-tos/manage-and-track-spending/manage-request-allowances{% endif %}'
- '{% ifversion ghec %}/copilot/tutorials/roll-out-at-scale/enable-developers/drive-adoption{% endif %}'
- '{% ifversion ghec %}/copilot/tutorials/roll-out-at-scale/enable-developers/integrate-ai-agents{% endif %}'
layout: product-landing
versions:
feature: copilot
Expand All @@ -36,4 +42,3 @@ topics:
- Copilot
contentType: landing
---

2 changes: 1 addition & 1 deletion content/rest/orgs/artifact-metadata.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Artifact metadata
title: REST API endpoints for artifact metadata
shortTitle: Artifact metadata
intro: "Use these endpoints to retrieve and manage metadata for artifacts in your organization. Artifact metadata provides information about build artifacts, their provenance, and related details."
versions: # DO NOT MANUALLY EDIT. CHANGES WILL BE OVERWRITTEN BY A 🤖
Expand Down
6 changes: 4 additions & 2 deletions data/allowed-topics.js → data/allowed-topics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// content model, add the entry to this list, and ensure you loop in the
// content and/or content strategy team for review.

export default [
const allowedTopics = [
'2FA',
'Access management',
'Accounts',
Expand Down Expand Up @@ -170,4 +170,6 @@ export default [
'Xamarin.iOS',
'Xamarin',
'Xcode',
]
] as const

export default allowedTopics
2 changes: 1 addition & 1 deletion src/automated-pipelines/tests/rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { get } from '@/tests/helpers/e2etest'

// Type definitions for page objects
type Page = {
autogenerated?: boolean
autogenerated?: string
fullPath: string
permalinks: Array<{ href: string }>
versions: {
Expand Down
19 changes: 12 additions & 7 deletions src/content-linter/tests/lint-frontmatter-links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ describe('front matter', () => {
async (page) => {
const redirectsContext = { redirects, pages }

const trouble = page.includeGuides
// Using any type for uri because includeGuides can contain various URI formats
const trouble = page
.includeGuides! // Using any type for uri because includeGuides can contain various URI formats
.map((uri: any, i: number) => checkURL(uri, i, redirectsContext))
.filter(Boolean)

const customErrorMessage = makeCustomErrorMessage(page, trouble, 'includeGuides')
expect(trouble.length, customErrorMessage).toEqual(0)

const counts = new Map()
for (const guide of page.includeGuides) {
for (const guide of page.includeGuides!) {
counts.set(guide, (counts.get(guide) || 0) + 1)
}
const countUnique = counts.size
let notDistinctMessage = `In ${page.relativePath} there are duplicate links in .includeGuides`
const dupes = [...counts.entries()].filter(([, count]) => count > 1).map(([entry]) => entry)
notDistinctMessage += `\nTo fix this, remove: ${dupes.join(' and ')}`
expect(page.includeGuides.length, notDistinctMessage).toEqual(countUnique)
expect(page.includeGuides!.length, notDistinctMessage).toEqual(countUnique)
},
)

Expand All @@ -78,12 +78,17 @@ describe('front matter', () => {
const redirectsContext = { redirects, pages }

const trouble = []
for (const links of Object.values(page.featuredLinks)) {
for (const links of Object.values(page.featuredLinks!)) {
// Some thing in `.featuredLinks` are not arrays.
// For example `popularHeading`. So just skip them.
if (!Array.isArray(links)) continue

trouble.push(...links.map((uri, i) => checkURL(uri, i, redirectsContext)).filter(Boolean))
trouble.push(
...links
.filter((link) => link.href)
.map((link, i) => checkURL(link.href, i, redirectsContext))
.filter(Boolean),
)
}

const customErrorMessage = makeCustomErrorMessage(page, trouble, 'featuredLinks')
Expand All @@ -98,7 +103,7 @@ describe('front matter', () => {
const redirectsContext = { redirects, pages }

const trouble = []
for (const linksRaw of Object.values(page.introLinks)) {
for (const linksRaw of Object.values(page.introLinks!)) {
const links = Array.isArray(linksRaw) ? linksRaw : [linksRaw]
trouble.push(
...links
Expand Down
Loading
Loading