diff --git a/apps/landing-page/next.config.mjs b/apps/landing-page/next.config.mjs index e5b77c0deb..58f34ff08e 100644 --- a/apps/landing-page/next.config.mjs +++ b/apps/landing-page/next.config.mjs @@ -1,3 +1,4 @@ +import createMDX from "@next/mdx"; import { configureRuntimeEnv } from "next-runtime-env/build/configure.js"; configureRuntimeEnv(); @@ -7,7 +8,8 @@ const nextConfig = { eslint: { ignoreDuringBuilds: true, }, - transpilePackages: ["utils", "models"], + transpilePackages: ["@typebot.io/lib"], + pageExtensions: ["mdx", "ts", "tsx"], async redirects() { return [ { @@ -38,4 +40,6 @@ const nextConfig = { }, }; -export default nextConfig; +const withMDX = createMDX({}); + +export default withMDX(nextConfig); diff --git a/apps/landing-page/package.json b/apps/landing-page/package.json index 75bee9025e..8df063bc6f 100644 --- a/apps/landing-page/package.json +++ b/apps/landing-page/package.json @@ -15,17 +15,21 @@ "@chakra-ui/react": "2.8.2", "@emotion/react": "11.11.4", "@emotion/styled": "11.11.5", + "@mdx-js/loader": "3.0.1", + "@mdx-js/react": "3.0.1", + "@next/mdx": "14.2.15", "@typebot.io/billing": "workspace:*", + "@typebot.io/env": "workspace:*", "@typebot.io/lib": "workspace:*", "@typebot.io/nextjs": "workspace:*", "@typebot.io/prisma": "workspace:*", "@typebot.io/typebot": "workspace:*", - "@typebot.io/env": "workspace:*", + "@types/mdx": "2.0.13", "aos": "2.3.4", + "fast-glob": "^3.3.2", "focus-visible": "5.2.0", "framer-motion": "11.1.7", "next": "14.2.13", - "next-mdx-remote": "4.4.1", "react": "18.2.0", "react-dom": "18.2.0", "react-tweet": "3.2.1", diff --git a/apps/landing-page/src/app/blog/[slug]/Post.tsx b/apps/landing-page/src/app/blog/[slug]/Post.tsx deleted file mode 100644 index 155812fa7f..0000000000 --- a/apps/landing-page/src/app/blog/[slug]/Post.tsx +++ /dev/null @@ -1,191 +0,0 @@ -/* eslint-disable jsx-a11y/alt-text */ -"use client"; - -import { EndCta } from "@/components/Homepage/EndCta"; -import { Link } from "@chakra-ui/next-js"; -import { - Alert, - AlertIcon, - AlertTitle, - Heading, - Stack, - Text, -} from "@chakra-ui/react"; -import { Standard } from "@typebot.io/nextjs"; -import { MDXRemote, type MDXRemoteSerializeResult } from "next-mdx-remote"; -import Image from "next/image"; -import { highlight } from "sugar-high"; -import { Table } from "./Table"; -import { Tweet } from "./Tweet"; - -type Props = { - metadata: { - title: string; - publishedAt: string; - }; - mdxSource: MDXRemoteSerializeResult; -}; - -export const Post = ({ metadata, mdxSource }: Props) => ( - - - {metadata.title} - {formatDate(metadata.publishedAt)} - - - , - h2: (props) => , - h3: (props) => , - h4: (props) => , - h5: (props) => , - h6: (props) => , - code: ({ children, ...props }) => { - if (!props.className || props.className?.includes("md")) - return {children}; - const hightlightedCode = highlight(children?.toString() ?? ""); - return ( - - ); - }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - link: (props: any) => , - Image: (props) => ( - - ), - Callout: ({ children, title, ...props }) => ( - - - {title ? {title} : null} - {children} - - ), - Tweet, - Typebot: (props) => ( - - ), - Youtube: ({ id }: { id: string }) => ( -
-
-