Skip to content

Commit 47881c5

Browse files
add metadata for title and description for all pages
1 parent e2414e5 commit 47881c5

File tree

7 files changed

+52
-9
lines changed

7 files changed

+52
-9
lines changed

app/dashboard/(overview)/page.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ import {
99
CardsSkeleton,
1010
} from '@/app/ui/skeletons';
1111

12+
import { Metadata } from "next";
13+
14+
export const metadata: Metadata = {
15+
title: 'Overview',
16+
};
1217
export default async function Page() {
1318
return (
1419
<main>

app/dashboard/customers/page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
import { Metadata} from "next";
2+
3+
export const metadata: Metadata = {
4+
title: 'Customers',
5+
};
6+
17
export default function Page() {
28
return <p>Customers Page</p>
39
}

app/dashboard/invoices/[id]/edit/page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ import Breadcrumbs from '@/app/ui/invoices/breadcrumbs';
33
import { fetchInvoiceById, fetchCustomers } from '@/app/lib/data';
44
import { notFound } from 'next/navigation';
55

6+
import { Metadata} from "next";
7+
8+
export const metadata: Metadata = {
9+
title: 'Edit Invoice',
10+
};
11+
612
export default async function Page({ params }: { params: { id: string } }) {
713
const id = params.id;
814
const [invoice, customers] = await Promise.all([

app/dashboard/invoices/create/page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import Form from '@/app/ui/invoices/create-form';
22
import Breadcrumbs from '@/app/ui/invoices/breadcrumbs';
33
import { fetchCustomers } from '@/app/lib/data';
4+
5+
import { Metadata} from "next";
6+
7+
export const metadata: Metadata = {
8+
title: 'Create Invoice',
9+
};
410

511
export default async function Page() {
612
const customers = await fetchCustomers();

app/dashboard/invoices/page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Metadata} from "next";
12
import Pagination from '@/app/ui/invoices/pagination';
23
import Search from '@/app/ui/search';
34
import Table from '@/app/ui/invoices/table';
@@ -7,6 +8,11 @@ import { lusitana } from '@/app/ui/fonts';
78
import { InvoicesTableSkeleton } from '@/app/ui/skeletons';
89
import { Suspense } from 'react';
910

11+
export const metadata: Metadata = {
12+
title: 'Invoices',
13+
description: 'Invoices',
14+
};
15+
1016
export default async function Page({
1117
searchParams,
1218
}: {

app/layout.tsx

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1+
import {Metadata} from "next";
12
import '@/app/ui/global.css';
2-
import { inter } from '@/app/ui/fonts';
3+
import {inter} from '@/app/ui/fonts';
34

5+
export const metadata: Metadata = {
6+
title: {
7+
template: '%s | Acme Dashboard',
8+
default: 'Acme Dashboard',
9+
},
10+
description: 'Acme is a fictional company used for demonstration purposes only.',
11+
metadataBase: new URL('https://next-learn-dashboard.vercel.sh')
12+
}
413
export default function RootLayout({
5-
children,
6-
}: {
7-
children: React.ReactNode;
14+
children,
15+
}: {
16+
children: React.ReactNode;
817
}) {
9-
return (
10-
<html lang="en">
11-
<body className={`${inter.className} antialiased`}>{children}</body>
12-
</html>
13-
);
18+
return (
19+
<html lang="en">
20+
<body className={`${inter.className} antialiased`}>{children}</body>
21+
</html>
22+
);
1423
}

app/login/page.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import AcmeLogo from "../ui/acme-logo";
22
import LoginForm from "../ui/login-form";
3+
import { Metadata} from "next";
4+
5+
export const metadata: Metadata = {
6+
title: 'Login',
7+
};
38

49
export default function LoginPage() {
510
return (

0 commit comments

Comments
 (0)