Starlight Sidebar Schema (types/sidebar.ts)

cloudflare-docs · src/schemas/types/sidebar.ts · typescript · CC-BY-4.0
ui, dev-tools, database, fw:astro, tag:validation

Provides Zod schemas for configuring Starlight documentation sidebars. Use this to validate and structure navigation menus in Astro-based documentation sites.

// Source: https://github.com/cloudflare/cloudflare-docs | License: CC-BY-4.0 | Copyright --then that use is not regulated by the license. Our
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Existing configuration options in Starlight's `sidebar` object are duplicated
 * here due to https://github.com/StefanTerdell/zod-to-json-schema/issues/68
 *
 * Existing options can be found in
 * https://github.com/withastro/starlight/blob/main/packages/starlight/schema.ts
 */

import { z } from "astro/zod";

/**
 * From https://github.com/withastro/starlight/blob/main/packages/starlight/schemas/badge.ts
 */

const linkHTMLAttributesSchema = z.record(
	z.string(),
	z.union([z.string(), z.number(), z.boolean(), z.undefined()]),
);

const SidebarLinkItemHTMLAttributesSchema = () 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key