Skip to content

Commit a4a1048

Browse files
committed
fix duplicate route warning
1 parent 29bc94e commit a4a1048

File tree

1 file changed

+2
-22
lines changed
  • src/plugins/docusaurus-plugin-virtual-files

1 file changed

+2
-22
lines changed

src/plugins/docusaurus-plugin-virtual-files/index.js

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -59,30 +59,10 @@ module.exports = (context, options) => ({
5959
return fileContents
6060
},
6161
async contentLoaded({ content, actions }) {
62-
const { createData, addRoute } = actions
62+
const { createData } = actions
6363

64-
// Create JSON data file
64+
// Create JSON data file for the quickstart page to consume
6565
const files = await createData('files.json', JSON.stringify(content))
66-
67-
const routePath = '/quickstart'
68-
69-
addRoute({
70-
path: routePath,
71-
exact: true,
72-
component: '@site/src/pages/quickstart',
73-
modules: {
74-
files,
75-
},
76-
})
77-
78-
// Add this to prevent other routes from being created in the quickstart namespace
79-
addRoute({
80-
path: `${routePath}/*`,
81-
component: '@site/src/pages/quickstart',
82-
modules: {
83-
files,
84-
},
85-
})
8666
},
8767
})
8868

0 commit comments

Comments
 (0)