Skip to content

Commit

Permalink
feat: a type to define all contentTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
mbifulco committed Feb 16, 2025
1 parent 371c6dd commit cbff005
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/data/content-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];

0 comments on commit cbff005

Please sign in to comment.