Fumadocs

Sources

Different sources for Contentlayer

Local Files

You can store documents locally in the content folder.

For advanced usages, you may directly interact with the output configuration.

Read the Files Section on their documentation to learn more about local source.

import { createConfig } from "fumadocs-contentlayer/configuration";
import { makeSource } from 'contentlayer/source-files';
 
const config = createConfig({ ... })
 
export default makeSource(config)

Remote Files

Assume your files are stored in a remote Git repository, Contentlayer supports remote sources which acts very similar to Files source.

You can see the examples in their docs.

import { createConfig } from "fumadocs-contentlayer/configuration";
import { makeSource } from 'contentlayer/source-files';
 
const config = createConfig({ ... })
 
export default makeSource({
    syncFiles: syncContentFromGit,
    ...config
})

Last updated on

On this page

Edit on Github