diff --git a/components/Blog/Layout.tsx b/components/Blog/Layout.tsx new file mode 100644 index 0000000..fcede5a --- /dev/null +++ b/components/Blog/Layout.tsx @@ -0,0 +1,25 @@ +import type { NextPage } from "next"; +import Head from "next/head"; +import Navigation from "./Navigation"; + +interface ILayoutProps { + title?: string; +} + +const Layout: NextPage = ({ title, children }) => { + return <> + + {title ?? "c0ntroller.de"} + +
+
+ +
+
+ { children } +
+
+ ; +}; + +export default Layout; \ No newline at end of file diff --git a/pages/blog/project/[pid].tsx b/pages/blog/project/[pid].tsx index 0f36b95..45448b3 100644 --- a/pages/blog/project/[pid].tsx +++ b/pages/blog/project/[pid].tsx @@ -1,6 +1,5 @@ import type { GetServerSideProps, NextPage } from "next"; -import Head from "next/head"; -import Navigation from "../../../components/Blog/Navigation"; +import Layout from "../../../components/Blog/Layout"; import { generateContent } from "../../../lib/content/generateBackend"; import type { ContentList } from "../../../lib/content/types"; @@ -16,18 +15,10 @@ interface IContentRender { } const Post: NextPage<{ content: IContentRender }> = ({ content }) => { - return <> - - {content.title} - c0ntroller.de - -
-
- -
-
-
-
- ; + return +
+
+
; }; export const getServerSideProps: GetServerSideProps = async (context) => { diff --git a/pages/index.tsx b/pages/index.tsx index 3c699f7..46d459b 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,12 +1,11 @@ import type { NextPage } from "next"; -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"; +import Layout from "../components/Blog/Layout"; const Blog: NextPage<{ content: ContentList }> = ({content}) => { const generateCards = (type: string) => { @@ -14,22 +13,14 @@ const Blog: NextPage<{ content: ContentList }> = ({content}) => { }; return <> - - c0ntroller.de - -
-
- -
-
-

Hello there!

-

Miaumiau Lorem ipsum

-

Projects

- { generateCards("project") } -

Diaries

- { generateCards("diary") } -
-
+ +

Hello there!

+

Miaumiau Lorem ipsum

+

Projects

+ { generateCards("project") } +

Diaries

+ { generateCards("diary") } +
; };