Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 88924e9

Browse files
committed
feat(#198): configure SEO for the main layout
1 parent c1d134a commit 88924e9

File tree

2 files changed

+48
-5
lines changed

2 files changed

+48
-5
lines changed

src/app/(pages)/x/page.tsx

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/app/layout.tsx

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { Metadata } from 'next';
22
import { Atkinson_Hyperlegible } from 'next/font/google';
3+
import { getSiteName } from '@/lib/funcs/site-name';
34
import Providers from '@/app/components/providers/all';
45
import { pub } from '@/lib/env';
56
import NavBar from './components/nav/nav';
@@ -11,15 +12,59 @@ const inter = Atkinson_Hyperlegible({
1112
weight: ['400', '700'],
1213
});
1314

15+
const title = 'ashgw.io';
16+
const description = 'Developer, writer, and modern day philosopher.';
17+
const url = new URL(pub.SITE_URL_PROD);
18+
const kw: string[] = ['blog', 'tech', 'TS', 'Python'];
19+
20+
const postImageWidth = 1200; // in pixels
21+
const postImageHeight = 630;
22+
const postImageUrl = `https://via.placeholder.com/${postImageWidth}x${postImageHeight}.png/000000/ffffff/?text=${title}`;
23+
1424
export const metadata: Metadata = {
15-
// TODO: figure out SEO when finished
1625
metadataBase: new URL(pub.SITE_URL_PROD),
17-
title: 'ashgw',
18-
description: '...',
26+
title: {
27+
default: 'Ashgw',
28+
template: '%s | Ashgw',
29+
},
30+
creator: 'Ashref Gwader',
31+
keywords: kw,
32+
description: 'Developer, writer, and modern day philosopher.',
33+
openGraph: {
34+
siteName: getSiteName(pub.SITE_URL_PROD) || pub.SITE_URL_PROD,
35+
locale: 'en_US',
36+
publishedTime: '2023-12-01T09:15:00-0401',
37+
title,
38+
description,
39+
type: 'article',
40+
url,
41+
images: [
42+
{
43+
url: postImageUrl,
44+
width: postImageWidth,
45+
height: postImageHeight,
46+
alt: title,
47+
},
48+
],
49+
},
1950
robots: {
2051
index: true,
2152
follow: true,
53+
googleBot: {
54+
index: true,
55+
follow: true,
56+
'max-video-preview': -1,
57+
'max-image-preview': 'large',
58+
'max-snippet': -1,
59+
},
60+
},
61+
twitter: {
62+
card: 'summary_large_image',
63+
title,
64+
description,
65+
images: [postImageUrl],
2266
},
67+
category: 'tech',
2368
};
2469

2570
export default async function RootLayout({

0 commit comments

Comments
 (0)