From f5926277d46e11c9cee239ed7a4c05469c76384c Mon Sep 17 00:00:00 2001 From: Yuxi Wang Date: Thu, 26 May 2022 14:59:08 -0700 Subject: [PATCH 1/3] Add subject to front matter - remove subtitle from project frontmatter --- src/blocks/types/frontMatter.ts | 4 +++- src/blocks/utils.spec.ts | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/blocks/types/frontMatter.ts b/src/blocks/types/frontMatter.ts index fada9771b..5c7511309 100644 --- a/src/blocks/types/frontMatter.ts +++ b/src/blocks/types/frontMatter.ts @@ -11,6 +11,7 @@ export type FrontMatterProps = { open_access: boolean | null; github: string | null; binder: string | null; + subject: string | null; subtitle: string | null; short_title: string | null; venue: { title?: string; url?: string } | null; @@ -35,7 +36,7 @@ export const PROJECT_FRONT_MATTER_KEYS = [ 'open_access', 'github', 'binder', - 'subtitle', + 'subject', 'short_title', ] as (keyof ProjectFrontMatterProps)[]; @@ -43,4 +44,5 @@ export const BLOCK_FRONT_MATTER_KEYS = [ ...PROJECT_FRONT_MATTER_KEYS, 'venue', 'biblio', + 'subtitle', ] as (keyof BlockFrontMatterProps)[]; diff --git a/src/blocks/utils.spec.ts b/src/blocks/utils.spec.ts index 3bec6f56d..e743311e2 100644 --- a/src/blocks/utils.spec.ts +++ b/src/blocks/utils.spec.ts @@ -39,6 +39,7 @@ describe('extractBlockFrontMatter', () => { arxiv: 'arxiv', binder: 'binder', subtitle: 'subtitle', + subject: 'subject', short_title: '', open_access: false, venue: {}, @@ -46,7 +47,7 @@ describe('extractBlockFrontMatter', () => { }; expect(extractBlockFrontMatter(frontmatter)).toEqual(frontmatter); - const { venue, biblio, ...projectExtractionResult } = frontmatter; + const { venue, biblio, subtitle, ...projectExtractionResult } = frontmatter; expect(extractProjectFrontMatter(frontmatter)).toEqual(projectExtractionResult); }); From 0a2bba6124f508afc0a464efd78f78c101f69463 Mon Sep 17 00:00:00 2001 From: Yuxi Wang Date: Thu, 26 May 2022 15:36:14 -0700 Subject: [PATCH 2/3] Update 'subtitle' to be omitted by ProjectFrontMatterProps --- src/blocks/types/frontMatter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blocks/types/frontMatter.ts b/src/blocks/types/frontMatter.ts index 5c7511309..f744e6b1d 100644 --- a/src/blocks/types/frontMatter.ts +++ b/src/blocks/types/frontMatter.ts @@ -25,7 +25,7 @@ export type FrontMatterProps = { export type BlockFrontMatterProps = Partial; -export type ProjectFrontMatterProps = Omit; +export type ProjectFrontMatterProps = Omit; // Exhausiveness is ensured in test export const PROJECT_FRONT_MATTER_KEYS = [ From 57162ece4a27a647809974ac5da9001d41e34d33 Mon Sep 17 00:00:00 2001 From: Yuxi Wang Date: Thu, 26 May 2022 15:59:31 -0700 Subject: [PATCH 3/3] Remove subtitle from ProjectFrontMatterProps --- src/blocks/utils.spec.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/blocks/utils.spec.ts b/src/blocks/utils.spec.ts index e743311e2..39735a8ba 100644 --- a/src/blocks/utils.spec.ts +++ b/src/blocks/utils.spec.ts @@ -8,7 +8,6 @@ export const TEST_PROJECT_FRONT_MATTER: ProjectFrontMatterProps = { open_access: false, github: '', binder: '', - subtitle: '', short_title: '', };