Add project page

This commit is contained in:
2022-10-07 23:03:39 +02:00
parent 85acc1bdac
commit f30332bc5e
16 changed files with 1677 additions and 36 deletions

View File

@@ -3,18 +3,21 @@ import Head from "next/head";
import type { ContentList } from "../lib/content/types";
import Navigation from "../components/Blog/Navigation";
import ProjectCard from "../components/Blog/Card";
import contentList from "../public/content/list.json";
import styles from "../styles/Blog/Front.module.scss";
const Blog: NextPage<{ content: ContentList }> = ({content}) => {
const generateCards = (type: string) => {
return <div className={styles.contentList}>{content.filter(p => p.type === type).map(p => <ProjectCard key={p.name} title={p.title} description={p.desc.join(" ")} />)}</div>;
return <div className={styles.contentList}>{content.filter(p => p.type === type).map(p => <ProjectCard key={p.name} title={p.title} description={p.desc.join(" ")} type={p.type} name={p.name} />)}</div>;
};
return <>
<Head>
<title>c0ntroller.de</title>
</Head>
<div className={styles.container}>
<div id={"blogBody"}>
<header>
<Navigation />
</header>
@@ -32,11 +35,7 @@ const Blog: NextPage<{ content: ContentList }> = ({content}) => {
};
export async function getServerSideProps() {
const url = process.env.BASE_URL || "https://c0ntroller.de";
const res = await fetch(`${url}/content/list.json`);
const content = await res.json();
return { props: { content } };
return { props: { content: contentList } };
}
export default Blog;