User guide layout (#5016)

- Modified CSS: font-size, colors, margins...

- Added an ArticleContent Component that will be used for the changelog
and user guide articles, which contains the styles for each titles,
paragraphs, images etc.

- Added link to User Guide in footer

- Added a UserGuideWarning Component: 

<img width="332" alt="Screenshot 2024-04-17 at 18 14 48"
src="https://github.com/twentyhq/twenty/assets/102751374/0f5c601b-a2c0-4c63-baeb-1990d65fc332">

- Added a UserGuideEditContent Component:

<img width="394" alt="Screenshot 2024-04-17 at 18 16 24"
src="https://github.com/twentyhq/twenty/assets/102751374/6c7c3bd4-c5bb-4d02-8f93-bd99bc30ce7b">

- Added a UserGuideLink Component (for usage in MDX to allow links to
open in new tab)

- Fixed table of content

- Made responsive

---------

Co-authored-by: Ady Beraud <a.beraud96@gmail.com>
Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
Ady Beraud
2024-04-22 18:04:26 +03:00
committed by GitHub
parent 68662fa543
commit b9a7eb5a98
44 changed files with 730 additions and 272 deletions

View File

@ -6,6 +6,10 @@ import path from 'path';
import rehypeSlug from 'rehype-slug';
import gfm from 'remark-gfm';
import ArticleEditContent from '@/app/_components/ui/layout/articles/ArticleEditContent';
import ArticleLink from '@/app/_components/ui/layout/articles/ArticleLink';
import ArticleWarning from '@/app/_components/ui/layout/articles/ArticleWarning';
interface ItemInfo {
title: string;
position?: number;
@ -103,6 +107,17 @@ export async function compileMDXFile(filePath: string, addToc = true) {
const fileContent = fs.readFileSync(filePath, 'utf8');
const compiled = await compileMDX<{ title: string; position?: number }>({
source: fileContent,
components: {
ArticleWarning(properties) {
return <ArticleWarning {...properties} />;
},
ArticleEditContent(properties) {
return <ArticleEditContent {...properties} />;
},
ArticleLink(properties) {
return <ArticleLink {...properties} />;
},
},
options: {
parseFrontmatter: true,
mdxOptions: {