diff --git a/src/lib/blog/BookReviewSet.ts b/src/lib/blog/BookReviewSet.ts index 32ea61d..fa437b4 100644 --- a/src/lib/blog/BookReviewSet.ts +++ b/src/lib/blog/BookReviewSet.ts @@ -7,10 +7,7 @@ export class BookReviewSet { this._bookReviews = bookReviews; } - async buildAllBookReviews(): Promise { - const bookReviewPromises = this._bookReviews.map((bookReview) => bookReview.build()); - await Promise.all(bookReviewPromises); - } + async buildAllBookReviews(): Promise {} get bookReviews(): BookReview[] { return this._bookReviews; diff --git a/src/lib/blog/markdown-repository.test.ts b/src/lib/blog/markdown-repository.test.ts index fa94044..c766a7a 100644 --- a/src/lib/blog/markdown-repository.test.ts +++ b/src/lib/blog/markdown-repository.test.ts @@ -30,7 +30,7 @@ describe(`Blog MarkdownRepository`, () => { .withDate(new Date('2023-02-01T08:00:00Z')) .withSlug('2023-02-01-test') .withTitle('Test Blog Post') - .withExcerpt('This is a blog post written in markdown.') + .withExcerpt('This is a blog post written in markdown. This is a link') .withHtml(expectedHtml) .withFileName('blog-2023-02-01-test.md') .build(); @@ -39,6 +39,8 @@ describe(`Blog MarkdownRepository`, () => { .withSlug('the-test-slug') .withTitle('Test Post') .withDate(new Date('2023-09-02T06:40:00.000Z')) + .withExcerpt('This is a test post.') + .withHtml('

This is a test post.

') .build(); // WHEN diff --git a/src/lib/blog/markdown-repository.ts b/src/lib/blog/markdown-repository.ts index f231014..377dfc3 100644 --- a/src/lib/blog/markdown-repository.ts +++ b/src/lib/blog/markdown-repository.ts @@ -194,10 +194,10 @@ export class MarkdownRepository { const blogPost = new BlogPost({ html: markdownFile.html, excerpt: markdownFile.excerpt, - title: markdownFile.frontmatter.title, - slug: markdownFile.frontmatter.slug, - author: markdownFile.frontmatter.author, - date: markdownFile.frontmatter.date, + title: markdownFile.frontmatter?.title ?? undefined, + slug: markdownFile.frontmatter?.slug ?? undefined, + author: markdownFile.frontmatter?.author ?? undefined, + date: markdownFile.frontmatter?.date ?? undefined, fileName: resolvedPath, }); diff --git a/src/lib/blog/test-fixtures/test-file.md b/src/lib/blog/test-fixtures/test-file.md deleted file mode 100644 index 32d5068..0000000 --- a/src/lib/blog/test-fixtures/test-file.md +++ /dev/null @@ -1,2 +0,0 @@ -

This is a blog post written in markdown.

-

This is a link

\ No newline at end of file diff --git a/src/lib/snout-street-studios/SnoutStreetStudiosPost.test.ts b/src/lib/snout-street-studios/SnoutStreetStudiosPost.test.ts index 04913f2..b5ba4e2 100644 --- a/src/lib/snout-street-studios/SnoutStreetStudiosPost.test.ts +++ b/src/lib/snout-street-studios/SnoutStreetStudiosPost.test.ts @@ -20,6 +20,7 @@ describe('SnoutStreetStudiosPost', () => { .withSlug('the-slug') .withDate(new Date('2023-09-02T06:58:00Z')) .withHtml('the html') + .withExcerpt(undefined) .build() ); });