@@ -14,8 +14,8 @@ featuredLinks:
|
||||
- /copilot/using-github-copilot/using-github-copilot-code-suggestions-in-your-editor
|
||||
popular:
|
||||
- /billing/managing-billing-for-github-copilot/about-billing-for-github-copilot
|
||||
- /copilot/configuring-github-copilot/configuring-github-copilot-in-your-environment
|
||||
- /copilot/configuring-github-copilot/configuring-your-personal-github-copilot-settings-on-githubcom
|
||||
- /copilot/managing-copilot/configure-personal-settings/configuring-github-copilot-in-your-environment
|
||||
- /copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/managing-copilot-policies-as-an-individual-subscriber
|
||||
layout: product-landing
|
||||
versions:
|
||||
feature: copilot
|
||||
@@ -29,8 +29,8 @@ children:
|
||||
- /managing-copilot
|
||||
- /github-copilot-chat
|
||||
- /github-copilot-in-the-cli
|
||||
- /configuring-github-copilot
|
||||
- /troubleshooting-github-copilot
|
||||
topics:
|
||||
- Copilot
|
||||
---
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ redirect_from:
|
||||
- /copilot/configuring-github-copilot/configuring-github-copilot-in-visual-studio-code
|
||||
- /copilot/configuring-github-copilot/configuring-github-copilot-in-a-jetbrains-ide
|
||||
- /copilot/configuring-github-copilot/configuring-github-copilot-in-neovim
|
||||
- /copilot/configuring-github-copilot/configuring-github-copilot-in-your-environment
|
||||
topics:
|
||||
- Copilot
|
||||
versions:
|
||||
@@ -7,6 +7,8 @@ topics:
|
||||
- Copilot
|
||||
versions:
|
||||
feature: copilot
|
||||
redirect_from:
|
||||
- /copilot/configuring-github-copilot/configuring-network-settings-for-github-copilot
|
||||
---
|
||||
|
||||
{% visualstudio %}
|
||||
@@ -1,14 +1,15 @@
|
||||
---
|
||||
title: Configuring GitHub Copilot
|
||||
shortTitle: Configure GitHub Copilot
|
||||
title: Configuring personal settings
|
||||
shortTitle: Configure personal settings
|
||||
intro: 'You can manage the configuration of {% data variables.product.prodname_copilot %} in a supported IDE, in your organization, or on {% data variables.product.prodname_dotcom_the_website %}.'
|
||||
versions:
|
||||
feature: copilot
|
||||
topics:
|
||||
- Copilot
|
||||
children:
|
||||
- /configuring-your-personal-github-copilot-settings-on-githubcom
|
||||
- /configuring-github-copilot-in-your-environment
|
||||
- /installing-the-github-copilot-extension-in-your-environment
|
||||
- /configuring-network-settings-for-github-copilot
|
||||
redirect_from:
|
||||
- /copilot/configuring-github-copilot
|
||||
---
|
||||
@@ -7,6 +7,8 @@ versions:
|
||||
defaultTool: vscode
|
||||
topics:
|
||||
- Copilot
|
||||
redirect_from:
|
||||
- /copilot/configuring-github-copilot/installing-the-github-copilot-extension-in-your-environment
|
||||
---
|
||||
|
||||
{% azure_data_studio %}
|
||||
@@ -10,4 +10,6 @@ children:
|
||||
- /managing-copilot-for-your-enterprise
|
||||
- /managing-github-copilot-in-your-organization
|
||||
- /managing-copilot-as-an-individual-subscriber
|
||||
- /configure-personal-settings
|
||||
---
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
---
|
||||
title: Managing Copilot as an individual subscriber
|
||||
shortTitle: Manage for individual
|
||||
intro: "Individual users can subscribe to {% data variables.product.prodname_copilot_individuals_short %} for personal use."
|
||||
intro: 'Individual users can subscribe to {% data variables.product.prodname_copilot_individuals_short %} for personal use.'
|
||||
versions:
|
||||
feature: copilot
|
||||
topics:
|
||||
- Copilot
|
||||
children:
|
||||
- /subscribing-to-copilot-as-an-individual-user
|
||||
- /managing-copilot-policies-as-an-individual-subscriber
|
||||
- /modifying-your-copilot-subscription-as-an-individual-user
|
||||
- /canceling-your-copilot-trial-as-an-individual-user
|
||||
- /canceling-copilot-as-an-individual-user
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Configuring your personal GitHub Copilot settings on GitHub.com
|
||||
shortTitle: Copilot on GitHub.com
|
||||
title: Managing Copilot policies as an individual subscriber
|
||||
shortTitle: Manage policies
|
||||
intro: 'Find out how to change your personal settings on {% data variables.product.prodname_dotcom_the_website %} to configure {% data variables.product.prodname_copilot %}''s behavior.'
|
||||
product: '{% data variables.product.prodname_copilot_for_individuals %}'
|
||||
topics:
|
||||
@@ -11,6 +11,7 @@ redirect_from:
|
||||
- /copilot/configuring-github-copilot/configuring-github-copilot-settings-on-githubcom
|
||||
- /github/copilot/about-github-copilot-telemetry
|
||||
- /github/copilot/github-copilot-telemetry-terms
|
||||
- /copilot/configuring-github-copilot/configuring-your-personal-github-copilot-settings-on-githubcom
|
||||
---
|
||||
|
||||
## About {% data variables.product.prodname_copilot %} settings on {% data variables.product.prodname_dotcom_the_website %}
|
||||
@@ -1,13 +1,15 @@
|
||||
import { productMap } from '#src/products/lib/all-products.js'
|
||||
import { deprecated } from '#src/versions/lib/enterprise-server-releases.js'
|
||||
import type { Request, Response, NextFunction } from 'express'
|
||||
|
||||
const pathRegExps = [
|
||||
import { productMap } from '@/products/lib/all-products.js'
|
||||
import { deprecated } from '@/versions/lib/enterprise-server-releases.js'
|
||||
|
||||
const pathRegExps: RegExp[] = [
|
||||
// Disallow indexing of WIP products
|
||||
...Object.values(productMap)
|
||||
.filter((product) => product.wip || product.hidden)
|
||||
.map((product) => [
|
||||
new RegExp(`^/.*?${product.href}`, 'i'),
|
||||
...product.versions.map((version) => new RegExp(`^/.*?${version}/${product.id}`, 'i')),
|
||||
...product.versions!.map((version) => new RegExp(`^/.*?${version}/${product.id}`, 'i')),
|
||||
]),
|
||||
|
||||
// Disallow indexing of deprecated enterprise versions
|
||||
@@ -17,11 +19,11 @@ const pathRegExps = [
|
||||
]),
|
||||
].flat()
|
||||
|
||||
export function blockIndex(path) {
|
||||
export function blockIndex(path: string) {
|
||||
return pathRegExps.some((pathRe) => pathRe.test(path))
|
||||
}
|
||||
|
||||
const middleware = function blockRobots(req, res, next) {
|
||||
const middleware = function blockRobots(req: Request, res: Response, next: NextFunction) {
|
||||
if (blockIndex(req.path)) res.set('x-robots-tag', 'noindex')
|
||||
return next()
|
||||
}
|
||||
@@ -24,7 +24,7 @@ import shortVersions from '@/versions/middleware/short-versions.js'
|
||||
import languageCodeRedirects from '@/redirects/middleware/language-code-redirects'
|
||||
import handleRedirects from '@/redirects/middleware/handle-redirects'
|
||||
import findPage from './find-page.js'
|
||||
import blockRobots from './block-robots.js'
|
||||
import blockRobots from './block-robots'
|
||||
import archivedEnterpriseVersionsAssets from '@/archives/middleware/archived-enterprise-versions-assets.js'
|
||||
import api from './api'
|
||||
import healthz from './healthz'
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import { blockIndex } from '#src/frame/middleware/block-robots.js'
|
||||
import { productMap } from '#src/products/lib/all-products.js'
|
||||
import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js'
|
||||
import { blockIndex } from '@/frame/middleware/block-robots'
|
||||
import { productMap } from '@/products/lib/all-products.js'
|
||||
import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases.js'
|
||||
|
||||
function allowIndex(path) {
|
||||
function allowIndex(path: string) {
|
||||
return !blockIndex(path)
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ describe('block robots', () => {
|
||||
|
||||
hiddenProductIds.forEach((id) => {
|
||||
const { versions } = productMap[id]
|
||||
if (!versions) return
|
||||
const blockedPaths = versions
|
||||
.map((version) => {
|
||||
return [`/en/${version}/${id}`, `/en/${version}/${id}/some-early-access-article`]
|
||||
@@ -1,9 +1,9 @@
|
||||
import { describe, expect, test, vi } from 'vitest'
|
||||
|
||||
import { languageKeys } from '#src/languages/lib/languages.js'
|
||||
import { blockIndex } from '#src/frame/middleware/block-robots.js'
|
||||
import { get, getDOMCached as getDOM } from '#src/tests/helpers/e2etest.js'
|
||||
import Page from '#src/frame/lib/page.js'
|
||||
import { languageKeys } from '@/languages/lib/languages.js'
|
||||
import { blockIndex } from '@/frame/middleware/block-robots'
|
||||
import { get, getDOMCached as getDOM } from '@/tests/helpers/e2etest.js'
|
||||
import Page from '@/frame/lib/page.js'
|
||||
|
||||
const langs = languageKeys.filter((lang) => lang !== 'en')
|
||||
|
||||
@@ -23,7 +23,7 @@ describe('frame', () => {
|
||||
test.each(langs)('homepage links go to %s pages', async (lang) => {
|
||||
const $ = await getDOM(`/${lang}`)
|
||||
const $links = $('[data-testid=bump-link]')
|
||||
$links.each((i, el) => {
|
||||
$links.each((i: number, el: Element) => {
|
||||
const linkUrl = $(el).attr('href')
|
||||
expect(linkUrl.startsWith(`/${lang}/`)).toBe(true)
|
||||
})
|
||||
@@ -96,10 +96,10 @@ describe('release notes', () => {
|
||||
//
|
||||
// This is useful because if we test every single individual version of
|
||||
// every plan the test just takes way too long.
|
||||
const getReleaseNotesVersionCombinations = (langs) => {
|
||||
const getReleaseNotesVersionCombinations = (langs: string[]) => {
|
||||
const combinations = []
|
||||
const prefixes = []
|
||||
for (const version of page.applicableVersions) {
|
||||
const prefixes: string[] = []
|
||||
for (const version of page!.applicableVersions) {
|
||||
const prefix = version.split('@')[0]
|
||||
if (prefixes.includes(prefix)) {
|
||||
continue
|
||||
7
src/products/lib/all-products.d.ts
vendored
Normal file
7
src/products/lib/all-products.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { Product } from '@/types'
|
||||
|
||||
export const { data }: Record<string, any>
|
||||
|
||||
export const productIds: string[]
|
||||
|
||||
export const productMap: Record<string, Product>
|
||||
@@ -46,8 +46,10 @@ export default async function contextualizeSearch(req, res, next) {
|
||||
}
|
||||
}
|
||||
|
||||
// Feature flag for now XXX
|
||||
if (req.context.currentVersion === 'enterprise-cloud@latest') {
|
||||
// Feature flag
|
||||
if (
|
||||
['enterprise-cloud', 'enterprise-server'].includes(req.context.currentVersion.split('@')[0])
|
||||
) {
|
||||
search.aggregate = ['toplevel']
|
||||
}
|
||||
|
||||
|
||||
12
src/types.ts
12
src/types.ts
@@ -14,15 +14,15 @@ export type ExtendedRequest = Request & {
|
||||
// Add more properties here as needed
|
||||
}
|
||||
|
||||
type Product = {
|
||||
export type Product = {
|
||||
id: string
|
||||
name: string
|
||||
href: string
|
||||
dir: string
|
||||
toc: string
|
||||
wip: boolean
|
||||
hidden: boolean
|
||||
versions: string[]
|
||||
dir?: string
|
||||
toc?: string
|
||||
wip?: boolean
|
||||
hidden?: boolean
|
||||
versions?: string[]
|
||||
}
|
||||
|
||||
type ProductMap = {
|
||||
|
||||
Reference in New Issue
Block a user