From eb1f3238322c653cb070ccbf98ae26860168be2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20C=C3=A9lio?= Date: Tue, 18 Jan 2022 20:25:24 -0300 Subject: [PATCH] feat: add previewImg to markdown files --- posts/src/en-US/testing-in-front-end.md | 1 + posts/src/pt-BR/testing-in-front-end.md | 1 + webapp/src/domain/ArticleMetadata.ts | 1 + webapp/src/infra/ArticleFileSystemRepository.ts | 3 ++- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/posts/src/en-US/testing-in-front-end.md b/posts/src/en-US/testing-in-front-end.md index 383bff8..d38c76c 100644 --- a/posts/src/en-US/testing-in-front-end.md +++ b/posts/src/en-US/testing-in-front-end.md @@ -3,6 +3,7 @@ title: Testing in Front End description: Learn how to do better testing in your front end. createdAt: '2021-11-03T02:11:11.781Z' updatedAt: '2021-11-03T02:11:11.781Z' +previewImg: /images/pyramid-of-testing-front-end.png tags: - front-end - testing diff --git a/posts/src/pt-BR/testing-in-front-end.md b/posts/src/pt-BR/testing-in-front-end.md index a52bcde..07a71ab 100644 --- a/posts/src/pt-BR/testing-in-front-end.md +++ b/posts/src/pt-BR/testing-in-front-end.md @@ -3,6 +3,7 @@ title: Teste no front end description: Aprenda a fazer melhores testes em seu front end. createdAt: '2021-11-03T02:11:11.781Z' updatedAt: '2021-11-03T02:11:11.781Z' +previewImg: /images/pyramid-of-testing-front-end.png tags: - front-end - testing diff --git a/webapp/src/domain/ArticleMetadata.ts b/webapp/src/domain/ArticleMetadata.ts index 7a8bde9..1c6943a 100644 --- a/webapp/src/domain/ArticleMetadata.ts +++ b/webapp/src/domain/ArticleMetadata.ts @@ -5,4 +5,5 @@ export interface ArticleMetadata { createdAt: string; updatedAt: string; readEstimateTimeInMinutes: number; + previewImg: string; } diff --git a/webapp/src/infra/ArticleFileSystemRepository.ts b/webapp/src/infra/ArticleFileSystemRepository.ts index 5694ed6..7818f2e 100644 --- a/webapp/src/infra/ArticleFileSystemRepository.ts +++ b/webapp/src/infra/ArticleFileSystemRepository.ts @@ -15,7 +15,7 @@ export class ArticleFileSystemRepository implements ArticleRepository { const filePath = path.join(this.articleFilePath, `${slug}.md`); const file = fs.readFileSync(filePath); const { - data: { title, createdAt, updatedAt, description }, + data: { title, createdAt, updatedAt, description, previewImg }, content, } = frontMatterParser(file); @@ -30,6 +30,7 @@ export class ArticleFileSystemRepository implements ArticleRepository { slug, content, readEstimateTimeInMinutes, + previewImg }; } async getAllArticleSlugs(): Promise {