Added SEO to website pages (#5106)

Added SEO to Contributors, Contributor, User Guide (+ each of it's
pages), Changelog, OSS friends: titles, descriptions

Co-authored-by: Ady Beraud <a.beraud96@gmail.com>
This commit is contained in:
Ady Beraud 2024-04-24 09:13:59 +03:00 committed by GitHub
parent dc82ff56b8
commit fda0c3c93c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 59 additions and 8 deletions

View File

@ -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!',
};
}

View File

@ -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;

View File

@ -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');

View File

@ -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 () => {

View File

@ -1,5 +1,22 @@
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,
@ -7,10 +24,6 @@ export default async function UserGuideSlug({
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} />;
}

View File

@ -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 />;
}

View File

@ -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);
}

View File

@ -0,0 +1,6 @@
export function formatSlug(slug: string): string {
return slug
.split('-')
.map((word: string) => word?.charAt(0)?.toUpperCase?.() + word?.slice?.(1))
.join(' ');
}