Skip to content

Commit 57fec0e

Browse files
committed
CRUD of the blog is completed
1 parent 5fd0d33 commit 57fec0e

File tree

7 files changed

+42
-4
lines changed

7 files changed

+42
-4
lines changed

app/(profile)/dashboard/page.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ import DeleteBlogBtn from '@/components/DeleteBlogBtn';
66
import EditBlogBtn from '@/components/EditBlogBtn';
77
import Link from 'next/link';
88
import Image from 'next/image';
9+
import type { Metadata } from "next";
10+
11+
export const metadata: Metadata = {
12+
title: "Blogger | Your Dashboard",
13+
description: "Manage your blog posts effortlessly with Blogger's Dashboard. View, edit, or delete your blogs and track your content at a glance.",
14+
};
15+
916

1017
interface Blog {
1118
id: string;

app/(profile)/layout.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
import SideMenu from "@/components/SideMenu";
2+
import type { Metadata } from "next";
3+
4+
export const metadata: Metadata = {
5+
title: "Blogger | Create a New Blog Post",
6+
description: "Start sharing your ideas on Blogger by creating a new blog post. Express yourself and connect with a global audience today.",
7+
};
8+
29

310
const layout = ({
411
children,

app/blog/[id]/page.tsx

+20
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
11
import { getBlog } from '@/utils/getBlog';
22
import Image from 'next/image';
33
import { notFound } from 'next/navigation';
4+
import type { Metadata } from "next";
45

56
interface ReadBlogProps {
67
params: Promise<{
78
id: string;
89
}>
910
}
1011

12+
export async function generateMetadata({ params }: ReadBlogProps): Promise<Metadata> {
13+
const { id } = await params;
14+
const blog = await getBlog(id);
15+
16+
// Default metadata
17+
if (!blog?.result) {
18+
return {
19+
title: 'Blogger | Discover and Share Blogs',
20+
description: 'Explore a wide range of blogs on Blogger, the platform where users can create, share, and engage with diverse content from all over the world.',
21+
};
22+
}
23+
24+
// Dynamic metadata based on blog content
25+
return {
26+
title: blog.result.blogName || 'Blogger | Discover and Share Blogs',
27+
description: blog.result.hook || 'Explore a wide range of blogs on Blogger.',
28+
};
29+
}
30+
1131
const ReadBlog = async ({ params }: ReadBlogProps) => {
1232
const {id} = await params;
1333
const blog = await getBlog(id);

app/favicon.ico

-25.3 KB
Binary file not shown.

app/layout.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
import type { Metadata } from "next";
21
import "./globals.css";
32
import Header from "@/components/Header";
43
import ContextAPI from "@/context/context";
54
import Footer from "@/components/Footer";
5+
import type { Metadata } from "next";
66

77
export const metadata: Metadata = {
8-
title: "Create Next App",
9-
description: "Generated by create next app",
8+
title: "Blogger | Discover and Share Blogs",
9+
description: "Explore a wide range of blogs on Blogger, the platform where users can create, share, and engage with diverse content from all over the world.",
1010
};
1111

12+
1213
export default function RootLayout({
1314
children,
1415
}: Readonly<{
1516
children: React.ReactNode;
1617
}>) {
1718
return (
1819
<html lang="en">
20+
<head>
21+
<link rel="icon" href="/favicon.png" type="image/png" />
22+
</head>
1923
<ContextAPI>
2024
<body>
2125
<Header/>

components/Footer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const Footer = () => {
6969
</div>
7070

7171
<div className="flex gap-5 justify-between items-center my-3">
72-
<p className="para text-sm">© 2077 Untitled UI. All rights reserved.</p>
72+
<p className="para text-sm">© 2025 developed by <Link href={"https://amanuelabera.vercel.app/"} target="_blank" className="hover:underline">Amanuel Abera</Link>. All rights reserved.</p>
7373
<div className="flex gap-3 items-center">
7474
<Link href={""} className="text-xl">
7575
<FaXTwitter />

public/favicon.png

780 Bytes
Loading

0 commit comments

Comments
 (0)