Fetching from multiple sourceBaseUrl
s
#41
-
Hello, I am wondering if it is possible to fetch from multiple locations with this plugin? I got it working with one path, but when I try multiple it seems to be unsupported. With the configuration below I'm getting this error: plugins: [
[
"docusaurus-plugin-remote-content",
{
name: "stream", // used by CLI, must be path safe
sourceBaseUrl: "https://raw.githubusercontent.com/resonatecoop/stream/development/", // the base url for the markdown (gets prepended to all of the documents when fetching)
outDir: "docs/basics", // the base directory to output to.
documents: ["README.md"], // the file names to download
},
{
name: "website", // used by CLI, must be path safe
sourceBaseUrl: "https://raw.githubusercontent.com/resonatecoop/website/develop/", // the base url for the markdown (gets prepended to all of the documents when fetching)
outDir: "docs/basics", // the base directory to output to.
documents: ["README.md"], // the file names to download
},
{
name: "id", // used by CLI, must be path safe
sourceBaseUrl: "https://raw.githubusercontent.com/resonatecoop/id/develop/", // the base url for the markdown (gets prepended to all of the documents when fetching)
outDir: "docs/basics", // the base directory to output to.
documents: ["README.md"], // the file names to download
},
{
name: "user-api", // used by CLI, must be path safe
sourceBaseUrl: "https://raw.githubusercontent.com/resonatecoop/user-api/master/", // the base url for the markdown (gets prepended to all of the documents when fetching)
outDir: "docs/basics", // the base directory to output to.
documents: ["README.md"], // the file names to download
},
{
name: "user-api-client", // used by CLI, must be path safe
sourceBaseUrl: "https://raw.githubusercontent.com/resonatecoop/user-api-client/master/", // the base url for the markdown (gets prepended to all of the documents when fetching)
outDir: "docs/basics", // the base directory to output to.
documents: ["README.md"], // the file names to download
},
{
name: "beam", // used by CLI, must be path safe
sourceBaseUrl: "https://raw.githubusercontent.com/simonv3/beam/main/", // the base url for the markdown (gets prepended to all of the documents when fetching)
outDir: "docs/ecosystem", // the base directory to output to.
documents: ["README.md"], // the file names to download
},
{
name: "stream-app", // used by CLI, must be path safe
sourceBaseUrl: "https://raw.githubusercontent.com/peterklingelhofer/stream-app/main/", // the base url for the markdown (gets prepended to all of the documents when fetching)
outDir: "docs/ecosystem", // the base directory to output to.
documents: ["README.md"], // the file names to download
},
],
], Thank you so much for creating this plugin. I think there is a big need for this sort of thing! I love how it can import MD files and it even correctly populates the table of contents on the right hand side in Docusaurus. For reference, I'm attempting to implement the above config in this repo: resonatecoop/docs. Thank you for your time. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey, the Docusaurus plugin API doesn't support multiple config objects in the same plugin instance, but you should be able to do it like this instead: plugins: [
[
"docusaurus-plugin-remote-content",
{
name: "stream", // used by CLI, must be path safe
sourceBaseUrl: "https://raw.githubusercontent.com/resonatecoop/stream/development/", // the base url for the markdown (gets prepended to all of the documents when fetching)
outDir: "docs/basics", // the base directory to output to.
documents: ["README.md"], // the file names to download
}
],
[
"docusaurus-plugin-remote-content",
{
name: "website", // used by CLI, must be path safe
sourceBaseUrl: "https://raw.githubusercontent.com/resonatecoop/website/develop/", // the base url for the markdown (gets prepended to all of the documents when fetching)
outDir: "docs/basics", // the base directory to output to.
documents: ["README.md"], // the file names to download
},
],
[
"docusaurus-plugin-remote-content",
{
name: "id", // used by CLI, must be path safe
sourceBaseUrl: "https://raw.githubusercontent.com/resonatecoop/id/develop/", // the base url for the markdown (gets prepended to all of the documents when fetching)
outDir: "docs/basics", // the base directory to output to.
documents: ["README.md"], // the file names to download
},
],
[
"docusaurus-plugin-remote-content",
{
name: "user-api", // used by CLI, must be path safe
sourceBaseUrl: "https://raw.githubusercontent.com/resonatecoop/user-api/master/", // the base url for the markdown (gets prepended to all of the documents when fetching)
outDir: "docs/basics", // the base directory to output to.
documents: ["README.md"], // the file names to download
}
],
[
"docusaurus-plugin-remote-content",
{
name: "user-api-client", // used by CLI, must be path safe
sourceBaseUrl: "https://raw.githubusercontent.com/resonatecoop/user-api-client/master/", // the base url for the markdown (gets prepended to all of the documents when fetching)
outDir: "docs/basics", // the base directory to output to.
documents: ["README.md"], // the file names to download
},
],
[
"docusaurus-plugin-remote-content",
{
name: "beam", // used by CLI, must be path safe
sourceBaseUrl: "https://raw.githubusercontent.com/simonv3/beam/main/", // the base url for the markdown (gets prepended to all of the documents when fetching)
outDir: "docs/ecosystem", // the base directory to output to.
documents: ["README.md"], // the file names to download
},
],
[
"docusaurus-plugin-remote-content",
{
name: "stream-app", // used by CLI, must be path safe
sourceBaseUrl: "https://raw.githubusercontent.com/peterklingelhofer/stream-app/main/", // the base url for the markdown (gets prepended to all of the documents when fetching)
outDir: "docs/ecosystem", // the base directory to output to.
documents: ["README.md"], // the file names to download
},
],
], |
Beta Was this translation helpful? Give feedback.
Hey, the Docusaurus plugin API doesn't support multiple config objects in the same plugin instance, but you should be able to do it like this instead: