2022-09-30 19:23:14 +02:00
|
|
|
import type { NextPage } from "next";
|
2021-12-17 18:55:00 +01:00
|
|
|
import Head from "next/head";
|
2022-09-30 19:23:14 +02:00
|
|
|
import useSWR from "swr";
|
2022-08-08 12:38:52 +02:00
|
|
|
import type { ContentList } from "../lib/content/types";
|
2022-09-30 19:23:14 +02:00
|
|
|
import Navigation from "../components/Blog/Navigation";
|
|
|
|
import ProjectCard from "../components/Blog/Card";
|
|
|
|
import Spinner from "../components/Spinner";
|
2021-11-30 23:48:54 +01:00
|
|
|
|
2022-09-30 19:23:14 +02:00
|
|
|
const Blog: NextPage<{}> = () => {
|
|
|
|
const { data: projectList, error } = useSWR("/content/list.json", (...args) => fetch(...args).then(res => res.json()));
|
2022-06-12 14:22:15 +02:00
|
|
|
|
2022-09-30 19:23:14 +02:00
|
|
|
return <>
|
2022-01-14 14:27:19 +01:00
|
|
|
<Head>
|
|
|
|
<title>c0ntroller.de</title>
|
|
|
|
</Head>
|
2022-09-30 19:23:14 +02:00
|
|
|
<Navigation />
|
|
|
|
<h1>Hello there!</h1>
|
|
|
|
<p>Miaumiau Lorem ipsum</p>
|
|
|
|
<h2>Projects</h2>
|
|
|
|
{
|
|
|
|
projectList ? (projectList as ContentList).filter(p => p.type === "project").map(p => <ProjectCard key={p.name} title={p.name} description={p.desc.join(" ")} />) : <Spinner size={200} />
|
2022-06-14 19:07:21 +02:00
|
|
|
}
|
2022-09-30 19:23:14 +02:00
|
|
|
<h2>Diaries</h2>
|
|
|
|
{
|
|
|
|
projectList ? (projectList as ContentList).filter(p => p.type === "diary").map(p => <ProjectCard key={p.name} title={p.name} description={p.desc.join(" ")} />) : <Spinner size={200} />
|
|
|
|
}
|
|
|
|
</>;
|
|
|
|
|
2022-06-14 19:07:21 +02:00
|
|
|
};
|
|
|
|
|
2022-09-30 19:23:14 +02:00
|
|
|
export default Blog;
|