Skip to content

Commit 75404ff

Browse files
committed
Other cleanup
1 parent 45a03ca commit 75404ff

File tree

4 files changed

+1
-51
lines changed

4 files changed

+1
-51
lines changed

src/components/SidebarIcon.astro

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/schemas/base.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { z } from "astro:schema";
22
import type { SchemaContext } from "astro:content";
33

4-
import { sidebar, SidebarIconSchema } from "./types/sidebar";
4+
import { sidebar } from "./types/sidebar";
55

66
const spotlightAuthorDetails = z
77
.object({
@@ -143,7 +143,6 @@ export const baseSchema = ({ image }: SchemaContext) =>
143143
.describe(
144144
"Displays a [Banner](https://developers.cloudflare.com/style-guide/frontmatter/banner/) on the current docs page.",
145145
),
146-
icon: SidebarIconSchema(),
147146
feedback: z
148147
.boolean()
149148
.default(true)

src/schemas/types/sidebar.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ const BadgeConfigSchema = () =>
4949
})
5050
.optional();
5151

52-
export const SidebarIconSchema = () =>
53-
z
54-
.object({
55-
lottieLink: z.string(),
56-
color: z.enum(["primary"]).optional(),
57-
})
58-
.optional();
59-
6052
export const sidebar = z
6153
.object({
6254
order: z.number().optional(),
@@ -79,7 +71,6 @@ export const sidebar = z
7971
"Hides the index page from the sidebar. Refer to [Sidebar](/style-guide/frontmatter/sidebar/).",
8072
),
8173
badge: BadgeConfigSchema(),
82-
icon: SidebarIconSchema(),
8374
})
8475
.optional(),
8576
})

src/util/sidebar.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ import { externalLinkArrow } from "~/plugins/rehype/external-links";
66

77
type Link = Extract<StarlightRouteData["sidebar"][0], { type: "link" }> & {
88
order?: number;
9-
icon?: { lottieLink: string };
109
};
1110
type Group = Extract<StarlightRouteData["sidebar"][0], { type: "group" }> & {
1211
order?: number;
13-
icon?: { lottieLink: string };
1412
};
1513

1614
export type SidebarEntry = Link | Group;
@@ -201,7 +199,6 @@ async function handleGroup(group: Group): Promise<SidebarEntry> {
201199

202200
const frontmatter = entry.data;
203201

204-
group.icon = frontmatter.sidebar.group?.icon ?? frontmatter.icon;
205202
group.label = frontmatter.sidebar.group?.label ?? frontmatter.title;
206203
group.order = frontmatter.sidebar.order ?? Number.MAX_VALUE;
207204

@@ -213,7 +210,6 @@ async function handleGroup(group: Group): Promise<SidebarEntry> {
213210
return {
214211
type: "link",
215212
href: index.href,
216-
icon: group.icon,
217213
label: group.label,
218214
order: group.order,
219215
attrs: {
@@ -288,7 +284,6 @@ async function handleLink(link: Link): Promise<Link> {
288284
if (frontmatter.external_link && !frontmatter.sidebar.group?.hideIndex) {
289285
return {
290286
...link,
291-
icon: frontmatter.icon,
292287
label: link.label.concat(externalLinkArrow),
293288
href: frontmatter.external_link,
294289
badge: frontmatter.external_link.startsWith("/api")

0 commit comments

Comments
 (0)