mirror of
https://github.com/github/awesome-copilot.git
synced 2026-08-25 10:21:40 +00:00
fix(website): drop 'In this article' TOC from resource detail pages
Resource detail pages (agent, instruction, skill, plugin, extension) are not articles, and their markdown headings do not form a meaningful outline. Playbook and cookbook articles keep their TOC. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 80686fef-efe3-4cdd-8cd6-bfa61a5d0af6
This commit is contained in:
@@ -3,11 +3,7 @@ import React from "react";
|
||||
|
||||
import { ActionMenu, Button } from "@primer/react-brand";
|
||||
|
||||
import {
|
||||
DetailChassis,
|
||||
type DetailSibling,
|
||||
type DetailTocItem,
|
||||
} from "./DetailChassis";
|
||||
import { DetailChassis, type DetailSibling } from "./DetailChassis";
|
||||
import { ResourceMeta } from "./ResourceMeta";
|
||||
import { pageHref } from "./pageHref";
|
||||
import type { SearchItem } from "./searchIndex";
|
||||
@@ -29,7 +25,6 @@ export type AgentDetailProps = {
|
||||
item: AgentDetailItem;
|
||||
/** Rendered, sanitized markdown body with heading ids already stamped. */
|
||||
markdownHtml: string;
|
||||
toc: DetailTocItem[];
|
||||
vscodeUrl: string;
|
||||
insidersUrl: string;
|
||||
githubUrl: string;
|
||||
@@ -45,7 +40,6 @@ export type AgentDetailProps = {
|
||||
export function AgentDetail({
|
||||
item,
|
||||
markdownHtml,
|
||||
toc,
|
||||
vscodeUrl,
|
||||
insidersUrl,
|
||||
githubUrl,
|
||||
@@ -138,7 +132,6 @@ export function AgentDetail({
|
||||
{ label: item.title },
|
||||
]}
|
||||
install={install}
|
||||
toc={toc}
|
||||
sidebar={
|
||||
<ResourceMeta
|
||||
kicker="Agent details"
|
||||
|
||||
@@ -9,11 +9,7 @@ import React from "react";
|
||||
|
||||
import { Button, Token } from "@primer/react-brand";
|
||||
|
||||
import {
|
||||
DetailChassis,
|
||||
type DetailSibling,
|
||||
type DetailTocItem,
|
||||
} from "./DetailChassis";
|
||||
import { DetailChassis, type DetailSibling } from "./DetailChassis";
|
||||
import { ResourceMeta } from "./ResourceMeta";
|
||||
import { pageHref } from "./pageHref";
|
||||
import type { SearchItem } from "./searchIndex";
|
||||
@@ -42,7 +38,6 @@ export type ExtensionDetailProps = {
|
||||
images: ExtensionDetailImage[];
|
||||
/** Rendered, sanitized README with heading ids already stamped. */
|
||||
markdownHtml: string;
|
||||
toc: DetailTocItem[];
|
||||
/** `ghapp://` deep link — absent for external extensions. */
|
||||
installUrl?: string | null;
|
||||
/** Copilot CLI command — absent for external extensions. */
|
||||
@@ -103,7 +98,6 @@ export function ExtensionDetail({
|
||||
item,
|
||||
images,
|
||||
markdownHtml,
|
||||
toc,
|
||||
installUrl,
|
||||
installCommand,
|
||||
sourceUrl,
|
||||
@@ -154,10 +148,6 @@ export function ExtensionDetail({
|
||||
</div>
|
||||
) : null;
|
||||
|
||||
const fullToc = hasPreview
|
||||
? [{ id: PREVIEW_SECTION_ID, label: "Preview" }, ...toc]
|
||||
: toc;
|
||||
|
||||
return (
|
||||
<DetailChassis
|
||||
title={item.name}
|
||||
@@ -168,7 +158,6 @@ export function ExtensionDetail({
|
||||
]}
|
||||
install={install}
|
||||
heroExtras={heroExtras}
|
||||
toc={fullToc}
|
||||
sidebar={
|
||||
<ResourceMeta
|
||||
kicker="Extension details"
|
||||
|
||||
@@ -3,11 +3,7 @@ import React from "react";
|
||||
|
||||
import { ActionMenu, Button, Token } from "@primer/react-brand";
|
||||
|
||||
import {
|
||||
DetailChassis,
|
||||
type DetailSibling,
|
||||
type DetailTocItem,
|
||||
} from "./DetailChassis";
|
||||
import { DetailChassis, type DetailSibling } from "./DetailChassis";
|
||||
import { ResourceMeta } from "./ResourceMeta";
|
||||
import { pageHref } from "./pageHref";
|
||||
import type { SearchItem } from "./searchIndex";
|
||||
@@ -28,7 +24,6 @@ export type InstructionDetailProps = {
|
||||
item: InstructionDetailItem;
|
||||
/** Rendered, sanitized markdown body with heading ids already stamped. */
|
||||
markdownHtml: string;
|
||||
toc: DetailTocItem[];
|
||||
/** `chat-instructions` VS Code install URL (see src/lib/detail-page.ts). */
|
||||
vscodeUrl: string;
|
||||
insidersUrl: string;
|
||||
@@ -45,7 +40,6 @@ export type InstructionDetailProps = {
|
||||
export function InstructionDetail({
|
||||
item,
|
||||
markdownHtml,
|
||||
toc,
|
||||
vscodeUrl,
|
||||
insidersUrl,
|
||||
githubUrl,
|
||||
@@ -144,7 +138,6 @@ export function InstructionDetail({
|
||||
]}
|
||||
install={install}
|
||||
heroExtras={heroExtras}
|
||||
toc={toc}
|
||||
sidebar={
|
||||
<ResourceMeta
|
||||
kicker="Instruction details"
|
||||
|
||||
@@ -15,11 +15,7 @@ import {
|
||||
import { clsx } from "clsx";
|
||||
|
||||
import type { ExternalSource } from "../../lib/external-source";
|
||||
import {
|
||||
DetailChassis,
|
||||
type DetailSibling,
|
||||
type DetailTocItem,
|
||||
} from "./DetailChassis";
|
||||
import { DetailChassis, type DetailSibling } from "./DetailChassis";
|
||||
import { ResourceMeta } from "./ResourceMeta";
|
||||
import { pageHref } from "./pageHref";
|
||||
import type { SearchItem } from "./searchIndex";
|
||||
@@ -57,7 +53,6 @@ export type PluginDetailProps = {
|
||||
item: PluginDetailItem;
|
||||
/** Rendered, sanitized README with heading ids already stamped. */
|
||||
markdownHtml: string;
|
||||
toc: DetailTocItem[];
|
||||
/** GitHub URL for the plugin source (repo tree, or the external repo). */
|
||||
githubUrl: string;
|
||||
/** Copilot CLI command that installs this plugin. */
|
||||
@@ -104,7 +99,6 @@ function itemTitle(item: PluginIncludedItem): string {
|
||||
export function PluginDetail({
|
||||
item,
|
||||
markdownHtml,
|
||||
toc,
|
||||
githubUrl,
|
||||
installCommand,
|
||||
lastUpdated,
|
||||
@@ -182,10 +176,6 @@ export function PluginDetail({
|
||||
</div>
|
||||
);
|
||||
|
||||
const chassisToc: DetailTocItem[] = hasContents
|
||||
? [{ id: "plugin-contents", label: "What's included" }, ...toc]
|
||||
: toc;
|
||||
|
||||
return (
|
||||
<DetailChassis
|
||||
title={item.name}
|
||||
@@ -196,7 +186,6 @@ export function PluginDetail({
|
||||
]}
|
||||
install={install}
|
||||
heroExtras={heroExtras}
|
||||
toc={chassisToc}
|
||||
sidebar={
|
||||
<ResourceMeta
|
||||
kicker="Plugin details"
|
||||
|
||||
@@ -10,11 +10,7 @@ import React from "react";
|
||||
|
||||
import { Button, Text } from "@primer/react-brand";
|
||||
|
||||
import {
|
||||
DetailChassis,
|
||||
type DetailSibling,
|
||||
type DetailTocItem,
|
||||
} from "./DetailChassis";
|
||||
import { DetailChassis, type DetailSibling } from "./DetailChassis";
|
||||
import { ResourceMeta } from "./ResourceMeta";
|
||||
import {
|
||||
SyntaxHighlightedCode,
|
||||
@@ -51,7 +47,6 @@ export type SkillDetailProps = {
|
||||
item: SkillDetailItem;
|
||||
/** Rendered, sanitized SKILL.md body with heading ids already stamped. */
|
||||
markdownHtml: string;
|
||||
toc: DetailTocItem[];
|
||||
/** GitHub tree URL for the skill folder. */
|
||||
githubUrl: string;
|
||||
/** `https://github.com/.../blob/main` — per-file links are built from this. */
|
||||
@@ -143,7 +138,6 @@ function encodeRepoPath(filePath: string): string {
|
||||
export function SkillDetail({
|
||||
item,
|
||||
markdownHtml,
|
||||
toc,
|
||||
githubUrl,
|
||||
githubBlobBase,
|
||||
rawBase,
|
||||
@@ -299,8 +293,6 @@ export function SkillDetail({
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
/* Anchors only exist while SKILL.md is on screen. */
|
||||
toc={isPrimary ? toc : []}
|
||||
sidebar={
|
||||
<ResourceMeta
|
||||
kicker="Skill details"
|
||||
|
||||
@@ -40,7 +40,7 @@ const { item, previous, next } = Astro.props as {
|
||||
};
|
||||
|
||||
const detail = loadDetailPage(item, "agent");
|
||||
const { html, toc } = buildDetailToc(detail.markdownHtml);
|
||||
const { html } = buildDetailToc(detail.markdownHtml);
|
||||
|
||||
const base = import.meta.env.BASE_URL ?? "/";
|
||||
const prefix = base.endsWith("/") ? base : base + "/";
|
||||
@@ -61,7 +61,6 @@ const downloadUrl = RAW_BASE + "/" + item.path;
|
||||
client:load
|
||||
item={item as any}
|
||||
markdownHtml={html}
|
||||
toc={toc}
|
||||
vscodeUrl={detail.vscodeUrl}
|
||||
insidersUrl={detail.insidersUrl}
|
||||
githubUrl={detail.githubUrl}
|
||||
|
||||
@@ -104,7 +104,7 @@ const images = Array.from(
|
||||
const { markdownHtml } = item.readmeFile
|
||||
? readResourceMarkdown(item.readmeFile)
|
||||
: { markdownHtml: "" };
|
||||
const { html, toc } = buildDetailToc(markdownHtml);
|
||||
const { html } = buildDetailToc(markdownHtml);
|
||||
|
||||
const lastUpdated = formatLastUpdated(item.lastUpdated ?? null);
|
||||
|
||||
@@ -139,7 +139,6 @@ const siblingOf = (sibling?: ExtensionItem) =>
|
||||
item={item}
|
||||
images={images}
|
||||
markdownHtml={html}
|
||||
toc={toc}
|
||||
installUrl={appInstallUrl}
|
||||
installCommand={item.external ? null : item.installCommand}
|
||||
sourceUrl={sourceUrl}
|
||||
|
||||
@@ -40,7 +40,7 @@ const { item, previous, next } = Astro.props as {
|
||||
};
|
||||
|
||||
const detail = loadDetailPage(item, "instruction");
|
||||
const { html, toc } = buildDetailToc(detail.markdownHtml);
|
||||
const { html } = buildDetailToc(detail.markdownHtml);
|
||||
|
||||
const base = import.meta.env.BASE_URL ?? "/";
|
||||
const prefix = base.endsWith("/") ? base : base + "/";
|
||||
@@ -61,7 +61,6 @@ const downloadUrl = RAW_BASE + "/" + item.path;
|
||||
client:load
|
||||
item={item as any}
|
||||
markdownHtml={html}
|
||||
toc={toc}
|
||||
vscodeUrl={detail.vscodeUrl}
|
||||
insidersUrl={detail.insidersUrl}
|
||||
githubUrl={detail.githubUrl}
|
||||
|
||||
@@ -61,7 +61,7 @@ const { markdownHtml } = item.readmeFile
|
||||
? readResourceMarkdown(item.readmeFile)
|
||||
: { markdownHtml: "" };
|
||||
|
||||
const { html, toc } = buildDetailToc(markdownHtml);
|
||||
const { html } = buildDetailToc(markdownHtml);
|
||||
|
||||
const githubUrl = item.external
|
||||
? externalRepoUrl(item.source, [item.repository, item.homepage, GITHUB_TREE])
|
||||
@@ -90,7 +90,6 @@ const siblingOf = (sibling?: PluginItem) =>
|
||||
client:load
|
||||
item={item}
|
||||
markdownHtml={html}
|
||||
toc={toc}
|
||||
githubUrl={githubUrl}
|
||||
installCommand={installCommand}
|
||||
lastUpdated={lastUpdated}
|
||||
|
||||
@@ -54,7 +54,7 @@ const { item, previous, next } = Astro.props as {
|
||||
const { markdownHtml, rawMarkdown } = readResourceMarkdown(item.skillFile);
|
||||
const lastUpdated = formatLastUpdated(item.lastUpdated);
|
||||
|
||||
const { html, toc } = buildDetailToc(markdownHtml);
|
||||
const { html } = buildDetailToc(markdownHtml);
|
||||
|
||||
const githubUrl = `${GITHUB_TREE_BASE}/${item.path}`;
|
||||
const installCommand = `gh skills install ${REPO_IDENTIFIER} ${item.id}`;
|
||||
@@ -72,7 +72,6 @@ const siblingOf = (sibling?: SkillItem) =>
|
||||
client:load
|
||||
item={item}
|
||||
markdownHtml={html}
|
||||
toc={toc}
|
||||
githubUrl={githubUrl}
|
||||
githubBlobBase={GITHUB_BLOB_BASE}
|
||||
rawBase={RAW_BASE}
|
||||
|
||||
Reference in New Issue
Block a user