diff --git a/src/pages/categories.tsx b/src/pages/categories.tsx index ee157d33..2083f38f 100644 --- a/src/pages/categories.tsx +++ b/src/pages/categories.tsx @@ -5,16 +5,14 @@ import Link from 'next/link' import { Container } from '../components/Container' import { Header } from '../components/Header' - -import { getSortedKnowledgeData } from '../lib/knowledgeFunctions' import { - getCategoriesAndNumberOfKnowledge, - CategoriesAndNumberOfKnowledge + CategoriesAndNumberOfPosts, + getCategoriesAndNumberOfPosts } from '../lib/categories' interface Props { avatarUrl: string - categories: CategoriesAndNumberOfKnowledge[] + categories: CategoriesAndNumberOfPosts[] } const Categories: React.FC = ({ avatarUrl, categories }) => { @@ -33,7 +31,7 @@ const Categories: React.FC = ({ avatarUrl, categories }) => {

{categoryData.category} - {categoryData.numberOfKnowledge} + {categoryData.numberOfPosts}

@@ -48,9 +46,7 @@ const Categories: React.FC = ({ avatarUrl, categories }) => { export default Categories export const getStaticProps: GetStaticProps = async () => { - const allKnowledgeData = getSortedKnowledgeData() - - const categories = getCategoriesAndNumberOfKnowledge(allKnowledgeData) + const categories = getCategoriesAndNumberOfPosts() return { props: {