The Local Folder Source is used to pull content from a folder located on the same machine as Mosaic is running.
It is common to use this source when running mosaic locally.
yarn add @jpmorganchase/mosaic-source-local-folder
Property | Description | Required |
---|---|---|
modulePath | The path to the installed module (@jpmorganchase/mosaic-source-local-folder) | Yes |
namespace | The scope for this source | Yes |
disabled | When true, content from this source is not used | No |
options.rootDir | The top level directory content will be pulled from | Yes |
options.prefixDir | The root path used in the content URL | Yes |
options.extensions | Collection of file extensions that the source will look for inside the rootDir | Yes |
This source will look for content with the ".mdx" extension in a "docs" directory 2 levels up from the Mosaic working directory. That content is included in the "local" namespace and available from a route that is prefixed with "local".
So if you had a file, docs/app/index.mdx
then you would be able to view it at http://localhost:3000/local/app/index
.