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

Skip to content

Commit e4bcc4b

Browse files
committed
fix: mismatch of SEO info for /blog & /contact
1 parent 2bf891b commit e4bcc4b

File tree

4 files changed

+75
-3
lines changed

4 files changed

+75
-3
lines changed

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

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,67 @@
11
import Posts from '@/app/components/post/posts';
22
import LoadingScreen from '@/app/components/reusables/loading-screen';
3+
import { pub } from '@/lib/env';
4+
import { getSiteName } from '@/lib/funcs/site-name';
5+
import { getBlogPosts } from '@/lib/mdx/content';
6+
import type { Metadata } from 'next';
37
import { notFound } from 'next/navigation';
48
import { Suspense } from 'react';
59

6-
import { getBlogPosts } from '../../../lib/mdx/content';
10+
const PAGE_URL = new URL(pub.SITE_URL_PROD + '/blog');
11+
const creator = 'Ashref Gwader';
12+
const title = 'Blog';
13+
const description = 'All about tech';
14+
const kw: string[] = [creator, 'ashgw', 'blog'];
15+
16+
const postImageWidth = 1200; // in pixels
17+
const postImageHeight = 630;
18+
const postImageUrl = `https://via.placeholder.com/${postImageWidth}x${postImageHeight}.png/000000/ffffff/?text=${title}`;
19+
20+
export const metadata: Metadata = {
21+
metadataBase: PAGE_URL,
22+
title: {
23+
default: title,
24+
template: '%s | Ashgw',
25+
},
26+
creator: creator,
27+
keywords: kw,
28+
description: description,
29+
openGraph: {
30+
siteName: getSiteName(pub.SITE_URL_PROD) || pub.SITE_URL_PROD,
31+
locale: 'en_US',
32+
publishedTime: '2023-12-01T09:15:00-0401',
33+
title,
34+
description,
35+
type: 'article',
36+
url: PAGE_URL,
37+
images: [
38+
{
39+
url: postImageUrl,
40+
width: postImageWidth,
41+
height: postImageHeight,
42+
alt: title,
43+
},
44+
],
45+
},
46+
robots: {
47+
index: true,
48+
follow: true,
49+
googleBot: {
50+
index: true,
51+
follow: true,
52+
'max-video-preview': -1,
53+
'max-image-preview': 'large',
54+
'max-snippet': -1,
55+
},
56+
},
57+
twitter: {
58+
card: 'summary_large_image',
59+
title,
60+
description,
61+
images: [postImageUrl],
62+
},
63+
category: 'tech',
64+
};
765

866
export default async function BlogPage() {
967
const posts = await getBlogPosts();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import type { Metadata } from 'next';
55

66
const PAGE_URL = new URL(pub.SITE_URL_PROD + '/contact');
77
const creator = 'Ashref Gwader';
8-
const title = 'About';
9-
const description = 'Contact me through email';
8+
const title = 'Contact';
9+
const description = 'Feel free to reach out';
1010
const kw: string[] = [creator, 'ashgw', 'contact'];
1111

1212
const postImageWidth = 1200; // in pixels

src/app/components/protos/hero-section.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,10 @@ import { Button } from '../ui/button';
415415

416416
/* eslint-disable */
417417

418+
/* eslint-disable */
419+
420+
/* eslint-disable */
421+
418422
function TypingAnimation() {
419423
const el = useRef(null);
420424

src/app/components/reusables/code/code-block.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,16 @@ import CopyButton from './copy-code';
233233

234234
// react-syntax-highlighter has no types
235235

236+
/* eslint-disable */
237+
// @ts-nocheck
238+
239+
// react-syntax-highlighter has no types
240+
241+
/* eslint-disable */
242+
// @ts-nocheck
243+
244+
// react-syntax-highlighter has no types
245+
236246
/* eslint-disable */
237247
// @ts-nocheck
238248
SyntaxHighlighter.registerLanguage('rust', rust);

0 commit comments

Comments
 (0)