@studiocms/blog
Version:
Add a blog to your StudioCMS project with ease!
112 lines (111 loc) • 3.9 kB
TypeScript
import { z } from 'astro/zod';
import { HeadConfigSchema } from 'studiocms/lib/head';
export type HeadUserConfig = z.input<ReturnType<typeof HeadConfigSchema>>;
export type HeadConfig = z.output<ReturnType<typeof HeadConfigSchema>>;
export declare const faviconTypeMap: {
'.ico': string;
'.gif': string;
'.jpeg': string;
'.jpg': string;
'.png': string;
'.svg': string;
};
export declare function isFaviconExt(ext: string): ext is keyof typeof faviconTypeMap;
/**
* Options for configuring the StudioCMS Blog.
*/
export declare const FrontEndConfigSchema: z.ZodDefault<z.ZodOptional<z.ZodObject<{
/**
* HTML Default Language - The default language for the HTML tag
* @default 'en'
*/
htmlDefaultLanguage: z.ZodDefault<z.ZodOptional<z.ZodString>>;
/**
* HTML Default Header - The default head configuration for the Frontend
*/
htmlDefaultHead: z.ZodDefault<z.ZodArray<z.ZodObject<{
tag: z.ZodEnum<["title", "base", "link", "style", "meta", "script", "noscript", "template"]>;
attrs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodUndefined]>>>;
content: z.ZodDefault<z.ZodString>;
}, "strip", z.ZodTypeAny, {
tag: "title" | "base" | "link" | "style" | "meta" | "script" | "noscript" | "template";
attrs: Record<string, string | boolean | undefined>;
content: string;
}, {
tag: "title" | "base" | "link" | "style" | "meta" | "script" | "noscript" | "template";
attrs?: Record<string, string | boolean | undefined> | undefined;
content?: string | undefined;
}>, "many">>;
/**
* Favicon Configuration - The default favicon configuration for the Frontend
*/
favicon: z.ZodDefault<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
/**
* Enable sitemap generation
* @default true
*/
sitemap: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
/**
* Inject routes
* @default true
*/
injectRoutes: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
/**
* The configuration for the blog
*/
blog: z.ZodDefault<z.ZodOptional<z.ZodObject<{
/**
* The title of the blog
*/
title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
/**
* Enable RSS feed
*/
enableRSS: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
/**
* The route for the blog
* @default '/blog'
* @example '/news'
*/
route: z.ZodDefault<z.ZodOptional<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
title: string;
enableRSS: boolean;
route: string;
}, {
title?: string | undefined;
enableRSS?: boolean | undefined;
route?: string | undefined;
}>>>;
}, "strip", z.ZodTypeAny, {
htmlDefaultLanguage: string;
htmlDefaultHead: {
tag: "title" | "base" | "link" | "style" | "meta" | "script" | "noscript" | "template";
attrs: Record<string, string | boolean | undefined>;
content: string;
}[];
favicon: string;
sitemap: boolean;
injectRoutes: boolean;
blog: {
title: string;
enableRSS: boolean;
route: string;
};
}, {
htmlDefaultLanguage?: string | undefined;
htmlDefaultHead?: {
tag: "title" | "base" | "link" | "style" | "meta" | "script" | "noscript" | "template";
attrs?: Record<string, string | boolean | undefined> | undefined;
content?: string | undefined;
}[] | undefined;
favicon?: string | undefined;
sitemap?: boolean | undefined;
injectRoutes?: boolean | undefined;
blog?: {
title?: string | undefined;
enableRSS?: boolean | undefined;
route?: string | undefined;
} | undefined;
}>>>;
export type StudioCMSBlogOptions = z.infer<typeof FrontEndConfigSchema>;