Files
website/node_modules/@astrojs/starlight/schemas/head.ts
2024-05-06 17:15:30 -04:00

19 lines
726 B
TypeScript

import { z } from 'astro/zod';
export const HeadConfigSchema = () =>
z
.array(
z.object({
/** Name of the HTML tag to add to `<head>`, e.g. `'meta'`, `'link'`, or `'script'`. */
tag: z.enum(['title', 'base', 'link', 'style', 'meta', 'script', 'noscript', 'template']),
/** Attributes to set on the tag, e.g. `{ rel: 'stylesheet', href: '/custom.css' }`. */
attrs: z.record(z.union([z.string(), z.boolean(), z.undefined()])).default({}),
/** Content to place inside the tag (optional). */
content: z.string().default(''),
})
)
.default([]);
export type HeadUserConfig = z.input<ReturnType<typeof HeadConfigSchema>>;
export type HeadConfig = z.output<ReturnType<typeof HeadConfigSchema>>;