From fae35f8dc2e18b71b8ea119270567ea4e687d171 Mon Sep 17 00:00:00 2001 From: Avior Date: Sun, 5 Jan 2020 00:49:41 +0100 Subject: [PATCH] Removed category index as I will recreate it Signed-off-by: Avior --- pages/[category]/index.tsx | 51 -------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 pages/[category]/index.tsx diff --git a/pages/[category]/index.tsx b/pages/[category]/index.tsx deleted file mode 100644 index a42023a..0000000 --- a/pages/[category]/index.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { NextPage, NextPageContext } from "next" -import Link from 'next/link' -import Post from "../../components/Post" -// import posts from '../../posts/pages.json' -// import firstline from 'firstline' -// import 'fs' - -interface Props { - files: fileInformations[] -} - -interface fileInformations { - title: string - slug: string -} - -const PortfolioIndex: NextPage = (props: Props) => { - - const el: JSX.Element[] = [] - for (const post of props.files) { - el.push( - ) - } - - return ( -
    - {props.files.map(post => ( -
  • - - {post.title} - -
  • - ))} -
- - ) -} - -PortfolioIndex.getInitialProps = async (context: NextPageContext) => { - const arr: fileInformations[] = [] - for (const post of await Post.fetchAll()) { - if (!post.isStarted) await post.fetch() - arr.push({ - slug: post.slug.replace(".md", ""), - title: post.title - }) - } - return {files: arr} -} - -export default PortfolioIndex