Skip to content

Commit 8540107

Browse files
ady-beraudady-test
andauthored
Added SEO to website pages (twentyhq#5106)
Added SEO to Contributors, Contributor, User Guide (+ each of it's pages), Changelog, OSS friends: titles, descriptions Co-authored-by: Ady Beraud <[email protected]>
1 parent 1651dcd commit 8540107

File tree

8 files changed

+59
-8
lines changed

8 files changed

+59
-8
lines changed

packages/twenty-website/src/app/contributors/[slug]/page.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ export function generateMetadata({
1919
params: { slug: string };
2020
}): Metadata {
2121
return {
22-
title: params.slug + ' | Contributors',
22+
title: 'Twenty - ' + params.slug,
23+
description:
24+
'Explore the impactful contributions of ' +
25+
params.slug +
26+
' on the Twenty Github Repo. Discover their merged pull requests, ongoing work, and top ranking. Join and contribute to the #1 Open-Source CRM thriving community!',
2327
};
2428
}
2529

packages/twenty-website/src/app/contributors/page.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ import { ContentContainer } from '@/app/_components/oss-friends/ContentContainer
77
import { findAll } from '@/database/database';
88
import { pullRequestModel, userModel } from '@/database/model';
99

10+
export const metadata = {
11+
title: 'Twenty - Contributors',
12+
description:
13+
'Discover the brilliant minds behind Twenty.com. Meet our contributors and explore how their expertise contributes to making Twenty the leading open-source CRM. Join our community today.',
14+
icons: '/images/core/logo.svg',
15+
};
16+
1017
interface Contributor {
1118
id: string;
1219
avatarUrl: string;

packages/twenty-website/src/app/oss-friends/page.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ import { CardContainer } from '@/app/_components/oss-friends/CardContainer';
44
import { ContentContainer } from '@/app/_components/oss-friends/ContentContainer';
55
import { Header } from '@/app/_components/oss-friends/Header';
66

7+
export const metadata = {
8+
title: 'Twenty - OSS friends',
9+
description:
10+
'At Twenty, we are proud to be part of a global open-source movement. Here are some of our fellow open source friends.',
11+
icons: '/images/core/logo.svg',
12+
};
13+
714
export default async function OssFriends() {
815
const ossList = await fetch('https://formbricks.com/api/oss-friends');
916

packages/twenty-website/src/app/releases/page.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import {
1212

1313
export const metadata: Metadata = {
1414
title: 'Twenty - Releases',
15-
description: 'Latest releases of Twenty',
15+
description:
16+
'Discover the newest features and improvements in Twenty, the #1 open-source CRM.',
1617
};
1718

1819
const Home = async () => {
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
1+
import { Metadata } from 'next';
2+
13
import UserGuideContent from '@/app/_components/user-guide/UserGuideContent';
2-
import { getPost } from '@/app/_server-utils/get-posts';
4+
import { fetchArticleFromSlug } from '@/shared-utils/fetchArticleFromSlug';
5+
import { formatSlug } from '@/shared-utils/formatSlug';
6+
7+
export async function generateMetadata({
8+
params,
9+
}: {
10+
params: { slug: string };
11+
}): Promise<Metadata> {
12+
const formattedSlug = formatSlug(params.slug);
13+
const basePath = '/src/content/user-guide';
14+
const mainPost = await fetchArticleFromSlug(params.slug, basePath);
15+
return {
16+
title: 'Twenty - ' + formattedSlug,
17+
description: mainPost?.itemInfo?.info,
18+
};
19+
}
320

421
export default async function UserGuideSlug({
522
params,
623
}: {
724
params: { slug: string };
825
}) {
926
const basePath = '/src/content/user-guide';
10-
11-
const mainPost = await getPost(
12-
params.slug && params.slug.length ? params.slug : 'home',
13-
basePath,
14-
);
27+
const mainPost = await fetchArticleFromSlug(params.slug, basePath);
1528
return mainPost && <UserGuideContent item={mainPost} />;
1629
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import UserGuideMain from '@/app/_components/user-guide/UserGuideMain';
22

3+
export const metadata = {
4+
title: 'Twenty - User Guide',
5+
description:
6+
'Discover how to use Twenty CRM effectively with our detailed user guide. Explore ways to customize features, manage tasks, integrate emails, and navigate the system with ease.',
7+
icons: '/images/core/logo.svg',
8+
};
9+
310
export default async function UserGuideHome() {
411
return <UserGuideMain />;
512
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { getPost } from '@/app/_server-utils/get-posts';
2+
3+
export async function fetchArticleFromSlug(slug: string, basePath: string) {
4+
const effectiveSlug = slug && slug.length > 0 ? slug : 'home';
5+
return await getPost(effectiveSlug, basePath);
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export function formatSlug(slug: string): string {
2+
return slug
3+
.split('-')
4+
.map((word: string) => word?.charAt(0)?.toUpperCase?.() + word?.slice?.(1))
5+
.join(' ');
6+
}

0 commit comments

Comments
 (0)