diff --git a/docs/pages/api/pagination-item.js b/docs/pages/api-docs/pagination-item.js similarity index 100% rename from docs/pages/api/pagination-item.js rename to docs/pages/api-docs/pagination-item.js diff --git a/docs/pages/api/pagination-item.md b/docs/pages/api-docs/pagination-item.md similarity index 100% rename from docs/pages/api/pagination-item.md rename to docs/pages/api-docs/pagination-item.md diff --git a/docs/pages/api/pagination.js b/docs/pages/api-docs/pagination.js similarity index 100% rename from docs/pages/api/pagination.js rename to docs/pages/api-docs/pagination.js diff --git a/docs/pages/api/pagination.md b/docs/pages/api-docs/pagination.md similarity index 100% rename from docs/pages/api/pagination.md rename to docs/pages/api-docs/pagination.md diff --git a/docs/pages/api/scoped-css-baseline.js b/docs/pages/api-docs/scoped-css-baseline.js similarity index 100% rename from docs/pages/api/scoped-css-baseline.js rename to docs/pages/api-docs/scoped-css-baseline.js diff --git a/docs/pages/api/scoped-css-baseline.md b/docs/pages/api-docs/scoped-css-baseline.md similarity index 100% rename from docs/pages/api/scoped-css-baseline.md rename to docs/pages/api-docs/scoped-css-baseline.md diff --git a/docs/src/modules/utils/find.js b/docs/src/modules/utils/find.js index 718abce8d0a853..fa8b2b9528c9ab 100644 --- a/docs/src/modules/utils/find.js +++ b/docs/src/modules/utils/find.js @@ -101,7 +101,7 @@ function findPages( if ( options.front && pathname.indexOf('/components') === -1 && - pathname.indexOf('/api') === -1 + pathname.indexOf('/api-docs') === -1 ) { return; } diff --git a/docs/src/server.js b/docs/src/server.js index aea1c693fe4c03..9e628bee6ae211 100644 --- a/docs/src/server.js +++ b/docs/src/server.js @@ -42,6 +42,7 @@ async function run() { // We remove it to normalize the pathname. // See `_rewriteUrlForNextExport` on Next.js side. pathname = pathname.replace(/\/$/, ''); + pathname = pathname.replace(/^\/api\/(.*)/, '/api-docs/$1'); } nextApp.render(req, res, pathname, {