How to reference files outside of Docusaurus root folder

Viewed 472

My team and I are looking to implement a documentation system that allows engineers to put markdown files within a specified folder in each of their service root directories. Since we are in a monorepo, we'd like to have a process that goes through and aggregates all of the necessary markdown files and statically generates a final site.

We'd love to use Docusaurus to handle this task; however, we are running into an issue where it seems unable to serve files that are outside of the directory that it is "installed" (where its config is/where it's invoked).

Example directories:

/docs/ <- docusaurus is in this folder
/service/_docs <- these are the markdown files we'd like to pull from

Docusaurus is able to (a) resolve the paths (b) writes the json metadata files. I can tell because I've added logging + I see the .json files that are generated in the .docusaurus folder.

We are using the plugin-content-docs and would love to avoid having to write our own plugin:


    [
      '@docusaurus/plugin-content-docs',
      {
        id: 'foo',
        path: path.resolve(__dirname, '..', 'service', '_docs'),
        routeBasePath: 'service'
      },
    ],
0 Answers
Related