From cbff0054ecb6c87b8e362483cf90bee12931097e Mon Sep 17 00:00:00 2001 From: Mike Bifulco Date: Sun, 16 Feb 2025 11:46:08 -0500 Subject: [PATCH] feat: a type to define all contentTypes --- src/data/content-types.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/data/content-types.ts b/src/data/content-types.ts index 11ea3d58..d3b1002f 100644 --- a/src/data/content-types.ts +++ b/src/data/content-types.ts @@ -100,3 +100,14 @@ export type Tag = string; * Union type of all possible frontmatter shapes */ export type ContentFrontmatter = NewsletterMetadata | Article['frontmatter']; + +export const ContentTypes = { + Post: 'post', + Newsletter: 'newsletter', + Article: 'article', +} as const; + +/** + * Union type of all content types on the site + */ +export type ContentType = (typeof ContentTypes)[keyof typeof ContentTypes];