From 82ce4b345a0e348df13a5a2bf4a4957ff47cc455 Mon Sep 17 00:00:00 2001 From: Nareshkumar Rao Date: Sat, 5 Apr 2025 01:12:38 +0200 Subject: [PATCH] couple more fixes --- src/app/about/page.tsx | 8 +++----- src/app/blog/[[...tag]]/page.tsx | 29 +++++++++++++++++++---------- src/app/not-found.tsx | 8 +++----- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/src/app/about/page.tsx b/src/app/about/page.tsx index d61a518..370775b 100644 --- a/src/app/about/page.tsx +++ b/src/app/about/page.tsx @@ -1,16 +1,14 @@ -/* eslint-disable react/no-unescaped-entities */ - export default function About() { return ( <> - so hey, i'm naresh! + so hey, i'm naresh!

- i'm an engineer and i love building things and tinkering on things. + i'm an engineer and i love building things and tinkering on things.

i like going on runs and going for rides on my bike.
-
umm, maybe i'll write more here later. +
umm, maybe i'll write more here later. ); } diff --git a/src/app/blog/[[...tag]]/page.tsx b/src/app/blog/[[...tag]]/page.tsx index bc1b17d..c5d14b0 100644 --- a/src/app/blog/[[...tag]]/page.tsx +++ b/src/app/blog/[[...tag]]/page.tsx @@ -20,6 +20,7 @@ export default async function Blog({ const pageNumber = await getPageNumber(searchParams); const { tag } = await params; const currentTag = tag != null && tag.length >= 1 ? tag[0] : null; + if ((tag?.length ?? 0) > 1) { notFound(); } @@ -28,9 +29,7 @@ export default async function Blog({ pageNumber, currentTag ); - if (pageNumber > numberOfPages) { - notFound(); - } + const loggedIn = (await auth())?.user != null; const tags = await getTags(loggedIn); @@ -46,13 +45,23 @@ export default async function Blog({ naresh writes ...occasionally - - {metadata - .filter((m) => loggedIn || !m.is_draft) - .map((m) => ( - - ))} - + {pageNumber > numberOfPages ? ( +
+ ah fuck. +
it seems like i haven't written anything yet +
so much for a blog, eh? +
+ ) : ( + <> + + {metadata + .filter((m) => loggedIn || !m.is_draft) + .map((m) => ( + + ))} + + + )} ); diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index 18a13ba..b1c4432 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -1,5 +1,3 @@ -/* eslint-disable react/no-unescaped-entities */ - import { titleFont } from "@/components/fonts"; import Link from "next/link"; @@ -11,11 +9,11 @@ export default function NotFound() {

- shit... something is fucked and now you're here + shit... something is fucked and now you're here
- i'll look into it, at some point + i'll look into it, at some point
- but for now, maybe you'd like to + but for now, maybe you'd like to