diff --git a/lib/createSlug.ts b/lib/createSlug.ts index fb3861a..c7e7b37 100644 --- a/lib/createSlug.ts +++ b/lib/createSlug.ts @@ -1,3 +1,5 @@ export function createSlug(title: string) { - return title.toLowerCase().replace(/[.,\s]+/g, '-') + return title.toLowerCase() + .replace(/\?/g, '') + .replace(/[.,\s]+/g, '-') } \ No newline at end of file diff --git a/mdx-components.tsx b/mdx-components.tsx index 2592b0d..7275e0c 100644 --- a/mdx-components.tsx +++ b/mdx-components.tsx @@ -1,4 +1,5 @@ -import type { MDXComponents } from 'mdx/types' +import type {MDXComponents} from 'mdx/types' +import {createSlug} from './lib/createSlug' // This file allows you to provide custom React components // to be used in MDX files. You can import and use any @@ -8,6 +9,7 @@ import type { MDXComponents } from 'mdx/types' // This file is required to use MDX in `app` directory. export function useMDXComponents(components: MDXComponents): MDXComponents { return { + h2: ({children}) =>

{children}#

, // Allows customizing built-in components, e.g. to add styling. // h1: ({ children }) =>

{children}

, ...components,