Skip to content

Commit

Permalink
feat: add previewImg to markdown files
Browse files Browse the repository at this point in the history
  • Loading branch information
jonyw4 committed Jan 18, 2022
1 parent aa08f06 commit eb1f323
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions posts/src/en-US/testing-in-front-end.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions posts/src/pt-BR/testing-in-front-end.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions webapp/src/domain/ArticleMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export interface ArticleMetadata {
createdAt: string;
updatedAt: string;
readEstimateTimeInMinutes: number;
previewImg: string;
}
3 changes: 2 additions & 1 deletion webapp/src/infra/ArticleFileSystemRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -30,6 +30,7 @@ export class ArticleFileSystemRepository implements ArticleRepository {
slug,
content,
readEstimateTimeInMinutes,
previewImg
};
}
async getAllArticleSlugs(): Promise<string[]> {
Expand Down

0 comments on commit eb1f323

Please sign in to comment.