From c4af151d6c4d3fe0365107b9244da85b617e52bb Mon Sep 17 00:00:00 2001 From: rattatwinko Date: Wed, 18 Jun 2025 19:27:05 +0200 Subject: [PATCH] Enhance blog layout and functionality; add social links configuration in .env.local, implement search functionality in Home component, and improve post page styling. --- .env.local | 10 +- src/app/api/admin/delete/route.ts | 14 +-- src/app/layout.tsx | 72 ++++++----- src/app/page.tsx | 202 +++++++++++++++++------------- src/app/posts/[...slug]/page.tsx | 13 +- 5 files changed, 175 insertions(+), 136 deletions(-) diff --git a/.env.local b/.env.local index 47a35b7..472a3e4 100644 --- a/.env.local +++ b/.env.local @@ -1,2 +1,10 @@ -NEXT_PUBLIC_BLOG_OWNER=Rattatwinko +#---------------------------------------------------------------------# +# In here you have to set your socials / links # +#---------------------------------------------------------------------# +NEXT_PUBLIC_BLOG_OWNER=Rattatwinko # Your Name goes here +NEXT_ABOUT_ME_LINK="http://localhost:80" # Your WebPage goes here +NEXT_SOCIAL_INSTAGRAM="http://instagram.com/rattatwinko" # Your Instagram Link goes here +NEXT_SOCIAL_TWITTER="https://twitter.com/user" # I dont have Twitter , if you have put your user there. +NEXT_SOCIAL_GITHUB_STATE="true" # I Have GitHub so this is True (if you dont then set this to false) +NEXT_SOCIAL_GITHUB_LINK_IF_TRUE="http://github.com/ZockerKatze" #If you have GitHub then paste your link here PORT=8080 \ No newline at end of file diff --git a/src/app/api/admin/delete/route.ts b/src/app/api/admin/delete/route.ts index 2cafa28..eb3548c 100644 --- a/src/app/api/admin/delete/route.ts +++ b/src/app/api/admin/delete/route.ts @@ -28,19 +28,9 @@ export async function POST(request: NextRequest) { // Construct the full path to the item let fullPath: string; if (type === 'post') { - // For posts, we need to handle the .md extension - if (itemPath) { - fullPath = path.join(postsDir, itemPath, `${name}.md`); - } else { - fullPath = path.join(postsDir, `${name}.md`); - } + fullPath = path.join(postsDir, itemPath || '', `${name}.md`); } else { - // For folders, we don't add the .md extension - if (itemPath) { - fullPath = path.join(postsDir, itemPath, name); - } else { - fullPath = path.join(postsDir, name); - } + fullPath = path.join(postsDir, itemPath || '', name); } console.log('Attempting to delete:', { diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 7ff302c..67c04a7 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -37,7 +37,7 @@ export default function RootLayout({ children: React.ReactNode; }) { return ( - + @@ -45,36 +45,48 @@ export default function RootLayout({ - -
-
-
- Markdown - Next.js - Tailwind CSS - TypeScript -
-
- - Instagram - - - GitHub - -
-
- -
-
-
- {children} -