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:
@ -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
packages/twenty-website/src/shared-utils/formatSlug.ts
Normal file
6
packages/twenty-website/src/shared-utils/formatSlug.ts
Normal 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(' ');
|
||||
}
|
||||
Reference in New Issue
Block a user