- Fixes #5504 - Fixes #5503 - Return 404 when the page does not exist - Modified the footer in order to align it properly - Removed "noticed something to change" in each table of content - Fixed the URLs of the edit module - Added the edit module to Developers - Fixed header style on the REST API page. - Edited the README to point to Developers - Fixed selected state when clicking on sidebar elements --------- Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
36 lines
991 B
TypeScript
36 lines
991 B
TypeScript
import { Metadata } from 'next';
|
|
import { notFound } from 'next/navigation';
|
|
|
|
import DocsContent from '@/app/_components/docs/DocsContent';
|
|
import { fetchArticleFromSlug } from '@/shared-utils/fetchArticleFromSlug';
|
|
import { formatSlug } from '@/shared-utils/formatSlug';
|
|
|
|
export const dynamic = 'force-dynamic';
|
|
|
|
export async function generateMetadata({
|
|
params,
|
|
}: {
|
|
params: { slug: string };
|
|
}): Promise<Metadata> {
|
|
const formattedSlug = formatSlug(params.slug);
|
|
const basePath = '/src/content/twenty-ui';
|
|
const mainPost = await fetchArticleFromSlug(params.slug, basePath);
|
|
return {
|
|
title: 'Twenty - ' + formattedSlug,
|
|
description: mainPost?.itemInfo?.info,
|
|
};
|
|
}
|
|
|
|
export default async function TwentyUISlug({
|
|
params,
|
|
}: {
|
|
params: { slug: string };
|
|
}) {
|
|
const basePath = '/src/content/twenty-ui';
|
|
const mainPost = await fetchArticleFromSlug(params.slug, basePath);
|
|
if (!mainPost) {
|
|
notFound();
|
|
}
|
|
return mainPost && <DocsContent item={mainPost} />;
|
|
}
|