Contentlayer

Next.js Example

Using Custom Components with MDX

By adding Components to the pages/posts/[slug].tsx file, you can use them across all your MDX files. As an example, we have added a simple Form component to this file.

Change me!

When you change a source file, Contentlayer automatically updates the content cache, which prompts Next.js to reload the content on screen.

Click me!

Blog posts have their own pages. The content source is a markdown file, parsed to HTML by Contentlayer.

What is Contentlayer?

Contentlayer makes working with content easy. It is a content preprocessor that validates and transforms your content into type-safe JSON you can easily import into your application.