Postprocess
Include useful information after compilation of content files.
Configurations
Note that postprocess is only available for doc/docs collections.
Processed Markdown
Include the processed Markdown content into static information before being converted into HTML.
import { defineDocs } from 'fumadocs-mdx/config';
export default defineDocs({
docs: {
postprocess: {
includeProcessedMarkdown: true,
},
},
});You can obtain the included content with getText() (e.g. in Fumadocs):
import { source } from '@/lib/source';
const page = source.getPage('...');
console.log(await page.data.getText('processed'));Export Properties from vfile.data
Some remark plugins store their output in vfile.data (compile-time memory) which cannot be accessed from your code.
You can add the name of vfile.data properties to valueToExport, they will be converted into ESM exports.
Hence, accessible when importing the MDX file.
import { defineDocs } from 'fumadocs-mdx/config';
export default defineDocs({
docs: {
postprocess: {
valueToExport: ['dataName'],
},
},
});How is this guide?
Last updated on
