Customization

Configure this docs site, and make it your own.

Site configuration

The config.json file in the content directory defines various site-wide properties:

Customize Content Collections

This site uses Content Collections to display MDX content. Two types of collections are used in its config file, which you can customize by updating their schemas.

If you want to add additional collection types (for example, blog pages) or just tweak the Content Collections options, you can edit its config file content-collections.ts at the root of this project.

Add custom MDX components

In addition to the available MDX components, you can add your own components to use in MDX pages.

Create a component

First, create your component in src/components/mdx/.

src/components/mdx/custom-component.tsx
export const CustomComponent = ({ children }: PropsWithChildren) => (
  <div>{children}</div>
);

Add to MDX components

Add your custom component to the list of available MDX components.

src/components/mdx/index.tsx
import { CustomComponent } from './custom-component';

export const mdxComponents = {
  // ...other components
  CustomComponent,
};

Use your new component

Now your custom component is ready to use! You can use it in any MDX page.

data/doc.mdx
<CustomComponent>
  Content of your custom component goes here.
</CustomComponent>

Customize... everything!

As this site is just a Next.js project, you can just customize everything in the src directory - including components, pages, styles and more. You can also customize config files outside of src.

Previous
Components & syntax
Next
Markdown test