rdilweb / docusaurus-plugin-remote-content

A Docusaurus plugin to download content from remote sources when it is needed.
MIT License
94 stars 12 forks source link

Allow path for content to be dynamic #29

Closed anarwal closed 2 years ago

anarwal commented 2 years ago

In order to use authorization with requestConfig, I am using github api and base url is like: sourceBaseUrl: "https://github.com/api/v3/repos/<org>/<repo>/contents/", in my repo the file I am trying to download is in a directory, so I have to use following documents value: documents: ["<dir-name>/<file-name>"]

While downloading this <dir-name> gets appended to output-dir. This makes the file result-path to be //.

Can you allow to provide output-file along with output-dir. This would make things a way lot easier to move the files around.

RDIL commented 2 years ago

A workaround for this is to have multiple different instances of the plugin with multiple output directories, but I'll see if I can add a setting for this before the next release.

RDIL commented 2 years ago

You can now do this using the modifyContent option. See the readme for more details.