Add blog page
This commit is contained in:
7
app/blog/neural-nets/page.tsx
Normal file
7
app/blog/neural-nets/page.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
export default async function Index() {
|
||||
return (
|
||||
<>
|
||||
<h1>hello</h1>
|
||||
</>
|
||||
);
|
||||
}
|
||||
23
app/blog/page.tsx
Normal file
23
app/blog/page.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
export default async function Index() {
|
||||
return (
|
||||
<div className="flex flex-col items-center">
|
||||
<div className="my-3 flex flex-col items-center">
|
||||
<h1 className="text-4xl">Stan's Blog</h1>
|
||||
<p className="text-sm my-1">
|
||||
<i>but what do I know</i>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h2 className="mt-3 text-2xl">Posts ({[].length})</h2>
|
||||
{/*
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/blog/neural-nets">Neural Networks</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/blog/nextjs">Next.js</a>
|
||||
</li>
|
||||
</ul> */}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { GeistSans } from "geist/font/sans";
|
||||
import "./globals.css";
|
||||
import TabItem from "@/components/TabItem";
|
||||
|
||||
const defaultUrl = process.env.VERCEL_URL
|
||||
? `https://${process.env.VERCEL_URL}`
|
||||
@@ -18,7 +19,14 @@ export default function RootLayout({
|
||||
}) {
|
||||
return (
|
||||
<html lang="en" className={GeistSans.className}>
|
||||
<body>{children}</body>
|
||||
<body>
|
||||
<div className="flex justify-center gap-5 my-5 font-bold">
|
||||
<TabItem targetPath="/" text="Home" />
|
||||
<TabItem targetPath="/blog" text="Blog" />
|
||||
</div>
|
||||
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
16
components/TabItem.tsx
Normal file
16
components/TabItem.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
"use client";
|
||||
|
||||
import { usePathname } from "next/navigation";
|
||||
|
||||
export default async function TabItem({ targetPath, text }: { targetPath: string, text: string}) {
|
||||
const currentPath = usePathname();
|
||||
|
||||
return (
|
||||
<a
|
||||
href={targetPath}
|
||||
className={currentPath === targetPath ? "underline" : ""}
|
||||
>
|
||||
{text}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user