Skip to content
✨ Publier v1 is live — a polished docs platform built for the open web.
On this page

publier.shell.schemas

The publier.shell.schemas module.

Overview

Types

BlogEntry

type BlogEntry = z.infer<typeof blogSchema>

Frontmatter schemas for Publier content collections.

Consumers wire these into content.config.ts:

import { defineCollection } from 'astro:content';
import { docsLoader } from '@publier/shell/loaders';
import { docsSchema, blogSchema, pagesSchema } from '@publier/shell/schemas';
export const collections = {
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
blog: defineCollection({ schema: blogSchema }),
pages: defineCollection({ schema: pagesSchema }),
};

docsSchema() accepts an extend option for adding custom fields per Astro’s content-collection extension pattern.

ChangelogEntry

type ChangelogEntry = z.infer<typeof changelogSchema>

DeprecationEntry

type DeprecationEntry = z.infer<typeof deprecationSchema>

DocsFrontmatter

type DocsFrontmatter = z.infer<DefaultSchema>

PageEntry

type PageEntry = z.infer<typeof pagesSchema>

Functions

docsSchema

function docsSchema<T extends ZodTypeAny = never>(opts?: DocsSchemaOpts<T>): ExtendedSchema<T>

Content-collection schema for Publier’s docs collection.

Parameters

NameType
optsDocsSchemaOpts<T>

Variables

BadgeConfigSchema

const BadgeConfigSchema = ...

Shape of a single badge used in sidebar items, cards, and frontmatter.

blogSchema

const blogSchema = ...

Frontmatter schemas for Publier content collections.

Consumers wire these into content.config.ts:

import { defineCollection } from 'astro:content';
import { docsLoader } from '@publier/shell/loaders';
import { docsSchema, blogSchema, pagesSchema } from '@publier/shell/schemas';
export const collections = {
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
blog: defineCollection({ schema: blogSchema }),
pages: defineCollection({ schema: pagesSchema }),
};

docsSchema() accepts an extend option for adding custom fields per Astro’s content-collection extension pattern.

CHANGELOG_TAGS

const CHANGELOG_TAGS = ...

The changelog tag vocabulary.

changelogSchema

const changelogSchema = ...

DEPRECATION_KINDS

const DEPRECATION_KINDS = ...

deprecationSchema

const deprecationSchema = ...

FrontmatterTableOfContentsSchema

const FrontmatterTableOfContentsSchema = ...

Frontmatter-level TOC override.

HeadConfigSchema

const HeadConfigSchema = ...

Head tag descriptor (matches Astro’s head-injection shape).

HeroSchema

const HeroSchema = ...

Hero block for splash-layout pages. Image is a string path or { light, dark } pair; no Astro image() optimization at the schema layer (Publier’s build pipeline handles image optimization elsewhere). Alt text required for accessibility.

pagesSchema

const pagesSchema = ...

PrevNextLinkConfigSchema

const PrevNextLinkConfigSchema = ...

Prev/Next navigation link config: true (auto), false (hide), string (label), or object.

SidebarLinkAttrsSchema

const SidebarLinkAttrsSchema = ...

HTML attribute map permitted on sidebar links.