diff --git a/src/utils/getNormalizedPost.js b/src/utils/getNormalizedPost.js deleted file mode 100644 index 5a00914..0000000 --- a/src/utils/getNormalizedPost.js +++ /dev/null @@ -1,27 +0,0 @@ -import getReadingTime from "reading-time"; - -export const getNormalizedPost = async (post) => { - const { frontmatter, compiledContent, rawContent, file } = post; - const ID = file.split("/").pop().split(".").shift(); - - return { - id: ID, - - pubDate: frontmatter.pubDate, - draft: frontmatter.draft, - - canonical: frontmatter.canonical, - slug: frontmatter.slug || ID, - - title: frontmatter.title, - description: frontmatter.description, - body: compiledContent(), - image: frontmatter.image, - - excerpt: frontmatter.excerpt, - authors: frontmatter.authors, - category: frontmatter.category, - tags: frontmatter.tags, - readingTime: Math.ceil(getReadingTime(rawContent()).minutes), - }; -};