Skip to content

Commit 41e49b1

Browse files
committed
feat: switch new OpenAPI docs to /api/v2
1 parent e4ecdd4 commit 41e49b1

File tree

4 files changed

+6
-50
lines changed

4 files changed

+6
-50
lines changed

apify-api/scripts/script-requirements.txt

Lines changed: 0 additions & 45 deletions
This file was deleted.

apify-docs-theme/static/js/custom.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ function scrollOpenApiSidebarItemIntoView() {
7878
function redirectOpenApiDocs() {
7979
const { hash, pathname, origin } = new URL(window.location.href);
8080

81-
// TODO change to '/api/v2'
82-
if (pathname.replace(/\/$/, '') !== '/api/v2-new') {
81+
if (pathname.startsWith('/api/v2') && pathname.startsWith('/api/v2-')) {
8382
return;
8483
}
8584

@@ -129,5 +128,6 @@ window.addEventListener('load', () => {
129128
});
130129

131130
window.addEventListener('popstate', () => {
131+
setTimeout(() => redirectOpenApiDocs(), 50);
132132
setTimeout(() => scrollOpenApiSidebarItemIntoView(), 50);
133133
});

docusaurus.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ module.exports = {
132132
specs: [
133133
{
134134
spec: './apify-api/openapi/openapi.yaml',
135-
route: '/api/v2/',
135+
route: '/api/v2-redoc/',
136136
},
137137
],
138138
theme: {
@@ -177,7 +177,7 @@ module.exports = {
177177
{
178178
id: 'openapi',
179179
path: './sources/api',
180-
routeBasePath: 'api/v2-new', // TODO change to `api/v2` once we are ready
180+
routeBasePath: 'api/v2',
181181
rehypePlugins: [externalLinkProcessor],
182182
showLastUpdateAuthor: false,
183183
showLastUpdateTime: false,

static/robots.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
User-agent: *
22
Sitemap: https://docs.apify.com/sitemap.xml
33
Disallow: https://docs.apify.com/api/v2-old
4-
Disallow: https://docs.apify.com/api/v2-new
4+
Disallow: https://docs.apify.com/api/v2-redoc
5+
Disallow: https://docs.apify.com/api/v2

0 commit comments

Comments
 (0)