diff --git a/content/copilot/example-prompts-for-github-copilot-chat/index.md b/content/copilot/example-prompts-for-github-copilot-chat/index.md index cd2a76c6f6..2b385faae1 100644 --- a/content/copilot/example-prompts-for-github-copilot-chat/index.md +++ b/content/copilot/example-prompts-for-github-copilot-chat/index.md @@ -14,11 +14,4 @@ children: - /documenting-code - /testing-code - /security-analysis -spotlight: - - article: /testing-code/generate-unit-tests - image: /assets/images/copilot-landing/generating_unit_tests.png - - article: /refactoring-code/improving-code-readability-and-maintainability - image: /assets/images/copilot-landing/improving_code_readability.png - - article: /debugging-errors/debugging-invalid-json - image: /assets/images/copilot-landing/debugging_invalid_json.png --- diff --git a/src/frame/components/context/CategoryLandingContext.tsx b/src/frame/components/context/CategoryLandingContext.tsx index 003ff974ff..3434ae772b 100644 --- a/src/frame/components/context/CategoryLandingContext.tsx +++ b/src/frame/components/context/CategoryLandingContext.tsx @@ -5,7 +5,7 @@ import { FeaturedLink, getFeaturedLinksFromReq, } from 'src/landings/components/ProductLandingContext' -import { TocItem, Spotlight } from '#src/landings/types.ts' +import { TocItem } from '#src/landings/types.ts' export type CategoryLandingContextT = { title: string @@ -18,7 +18,6 @@ export type CategoryLandingContextT = { renderedPage: string currentLearningTrack?: LearningTrack currentLayout: string - currentSpotlight: Array } export const CategoryLandingContext = createContext(null) @@ -49,6 +48,5 @@ export const getCategoryLandingContextFromRequest = (req: any): CategoryLandingC renderedPage: req.context.renderedPage, currentLearningTrack: req.context.currentLearningTrack, currentLayout: req.context.currentLayoutName, - currentSpotlight: req.context.page.spotlight, } } diff --git a/src/frame/lib/frontmatter.js b/src/frame/lib/frontmatter.js index ceb9726c1b..5e7c855ca3 100644 --- a/src/frame/lib/frontmatter.js +++ b/src/frame/lib/frontmatter.js @@ -262,22 +262,6 @@ export const schema = { octicon: { type: 'string', }, - spotlight: { - type: 'array', - minItems: 3, - maxItems: 3, - items: { - type: 'object', - properties: { - article: { - type: 'string', - }, - image: { - type: 'string', - }, - }, - }, - }, // END category landing tags }, } diff --git a/src/landings/components/CategoryLanding.tsx b/src/landings/components/CategoryLanding.tsx index 98b4191909..8dac7779ef 100644 --- a/src/landings/components/CategoryLanding.tsx +++ b/src/landings/components/CategoryLanding.tsx @@ -8,12 +8,14 @@ import { DefaultLayout } from 'src/frame/components/DefaultLayout' import { ArticleTitle } from 'src/frame/components/article/ArticleTitle' import { Lead } from 'src/frame/components/ui/Lead' import { useCategoryLandingContext } from 'src/frame/components/context/CategoryLandingContext' +import { ClientSideRedirects } from 'src/rest/components/ClientSideRedirects' +import { RestRedirect } from 'src/rest/components/RestRedirect' import { Breadcrumbs } from 'src/frame/components/page-header/Breadcrumbs' import { ArticleCardItems } from 'src/landings/types' export const CategoryLanding = () => { const router = useRouter() - const { title, intro, tocItems, currentSpotlight } = useCategoryLandingContext() + const { title, intro, tocItems } = useCategoryLandingContext() // tocItems contains directories and its children, we only want the child articles const onlyFlatItems: ArticleCardItems = tocItems.flatMap((item) => item.childTocItems || []) @@ -70,6 +72,11 @@ export const CategoryLanding = () => { } return ( + {router.route === '/[versionId]/rest/[category]' && } + {/* Doesn't matter *where* this is included because it will + never render anything. It always just return null. */} + +
@@ -79,39 +86,36 @@ export const CategoryLanding = () => {

Spotlight

- { - // The articles in the spotlight should be contained within the page's children. If not, we throw. - currentSpotlight.map((spotlightItem, index) => { - const matchedItem = onlyFlatItems.find((item) => - item.fullPath.endsWith(spotlightItem.article), - ) - if ( - !matchedItem || - !matchedItem.title || - !matchedItem.intro || - !matchedItem.fullPath - ) { - throw new Error( - `Couldn't find the articles defined in the spotlight region defined for ${router.asPath}. Check that page's spotlight frontmater property.`, - ) - } - - // A missing image is possible, in that case the CookBookArticleCard component can handle a placeholder at a future iteration. - return ( -
- -
- ) - }) - } +
+ +
+
+ +
+
+ +
diff --git a/src/landings/types.ts b/src/landings/types.ts index a768528c72..b38c9e66db 100644 --- a/src/landings/types.ts +++ b/src/landings/types.ts @@ -27,8 +27,3 @@ export type TocItem = BaseTocItem & { } export type ArticleCardItems = ChildTocItem[] - -export type Spotlight = { - article: string - image: string -}