2023-11-09 08:26:44 +00:00
|
|
|
import { ObjectValue } from "$sb/types.ts";
|
|
|
|
|
|
|
|
export type TemplateFrontmatter = {
|
2023-12-21 17:37:50 +00:00
|
|
|
displayName?: string;
|
|
|
|
type?: "page";
|
2023-11-09 08:26:44 +00:00
|
|
|
// Frontmatter can be encoded as an object (in which case we'll serialize it) or as a string
|
|
|
|
frontmatter?: Record<string, any> | string;
|
2024-01-04 19:08:12 +00:00
|
|
|
|
|
|
|
// Specific for slash templates
|
|
|
|
trigger?: string;
|
|
|
|
|
|
|
|
// Specific for frontmatter templates
|
|
|
|
where?: string; // expression (SB query style)
|
|
|
|
priority?: number; // When multiple templates match, the one with the highest priority is used
|
2023-11-09 08:26:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export type TemplateObject = ObjectValue<TemplateFrontmatter>;
|