mirror of
https://github.com/sern-handler/website
synced 2026-06-28 02:32:23 +00:00
19 lines
726 B
TypeScript
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>>;
|