Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added SEO to website pages #5106

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/twenty-website/src/app/contributors/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ export function generateMetadata({
params: { slug: string };
}): Metadata {
return {
title: params.slug + ' | Contributors',
title: 'Twenty - ' + params.slug,
description:
'Explore the impactful contributions of ' +
params.slug +
' 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!',
};
}

Expand Down
7 changes: 7 additions & 0 deletions packages/twenty-website/src/app/contributors/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ import { ContentContainer } from '@/app/_components/oss-friends/ContentContainer
import { findAll } from '@/database/database';
import { pullRequestModel, userModel } from '@/database/model';

export const metadata = {
title: 'Twenty - Contributors',
description:
'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.',
icons: '/images/core/logo.svg',
};

interface Contributor {
id: string;
avatarUrl: string;
Expand Down
7 changes: 7 additions & 0 deletions packages/twenty-website/src/app/oss-friends/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import { CardContainer } from '@/app/_components/oss-friends/CardContainer';
import { ContentContainer } from '@/app/_components/oss-friends/ContentContainer';
import { Header } from '@/app/_components/oss-friends/Header';

export const metadata = {
title: 'Twenty - OSS friends',
description:
'At Twenty, we are proud to be part of a global open-source movement. Here are some of our fellow open source friends.',
icons: '/images/core/logo.svg',
};

export default async function OssFriends() {
const ossList = await fetch('https://formbricks.com/api/oss-friends');

Expand Down
3 changes: 2 additions & 1 deletion packages/twenty-website/src/app/releases/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {

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

const Home = async () => {
Expand Down
25 changes: 19 additions & 6 deletions packages/twenty-website/src/app/user-guide/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
import { Metadata } from 'next';

import UserGuideContent from '@/app/_components/user-guide/UserGuideContent';
import { getPost } from '@/app/_server-utils/get-posts';
import { fetchArticleFromSlug } from '@/shared-utils/fetchArticleFromSlug';
import { formatSlug } from '@/shared-utils/formatSlug';

export async function generateMetadata({
params,
}: {
params: { slug: string };
}): Promise<Metadata> {
const formattedSlug = formatSlug(params.slug);
const basePath = '/src/content/user-guide';
const mainPost = await fetchArticleFromSlug(params.slug, basePath);
return {
title: 'Twenty - ' + formattedSlug,
description: mainPost?.itemInfo?.info,
};
}

export default async function UserGuideSlug({
params,
}: {
params: { slug: string };
}) {
const basePath = '/src/content/user-guide';

const mainPost = await getPost(
params.slug && params.slug.length ? params.slug : 'home',
basePath,
);
const mainPost = await fetchArticleFromSlug(params.slug, basePath);
return mainPost && <UserGuideContent item={mainPost} />;
}
7 changes: 7 additions & 0 deletions packages/twenty-website/src/app/user-guide/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import UserGuideMain from '@/app/_components/user-guide/UserGuideMain';

export const metadata = {
title: 'Twenty - User Guide',
description:
'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.',
icons: '/images/core/logo.svg',
};

export default async function UserGuideHome() {
return <UserGuideMain />;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { getPost } from '@/app/_server-utils/get-posts';

export async function fetchArticleFromSlug(slug: string, basePath: string) {
const effectiveSlug = slug && slug.length > 0 ? slug : 'home';
return await getPost(effectiveSlug, basePath);
}
6 changes: 6 additions & 0 deletions packages/twenty-website/src/shared-utils/formatSlug.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export function formatSlug(slug: string): string {
return slug
.split('-')
.map((word: string) => word?.charAt(0)?.toUpperCase?.() + word?.slice?.(1))
.join(' ');
}
Loading