Multiple Types
Support multiple type of documents in your Next.js app
You can have multiple document types, such as a blog post, or a document. By
passing the rootDir
option, the resolved files will be restricted within a
specified folder.
Usage
Set a root directory, notice that this will make all resolved files relative to the directory.
const blog = fromMap(map, {
rootDir: 'mdx',
baseUrl: '/docs/mdx',
});
Custom Slugs
You may override the getSlugs
property to customise the way it generates slugs.
const blog = fromMap(map, {
rootDir: 'mdx',
baseUrl: '/docs/mdx',
getSlugs: ...
});
Last updated on 12/11/2023