Skip to content

Commit

Permalink
feat: switch new OpenAPI docs to /api/v2
Browse files Browse the repository at this point in the history
  • Loading branch information
B4nan committed Jan 14, 2025
1 parent e4ecdd4 commit 41e49b1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 50 deletions.
45 changes: 0 additions & 45 deletions apify-api/scripts/script-requirements.txt

This file was deleted.

4 changes: 2 additions & 2 deletions apify-docs-theme/static/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ function scrollOpenApiSidebarItemIntoView() {
function redirectOpenApiDocs() {
const { hash, pathname, origin } = new URL(window.location.href);

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

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

window.addEventListener('popstate', () => {
setTimeout(() => redirectOpenApiDocs(), 50);
setTimeout(() => scrollOpenApiSidebarItemIntoView(), 50);
});
4 changes: 2 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ module.exports = {
specs: [
{
spec: './apify-api/openapi/openapi.yaml',
route: '/api/v2/',
route: '/api/v2-redoc/',
},
],
theme: {
Expand Down Expand Up @@ -177,7 +177,7 @@ module.exports = {
{
id: 'openapi',
path: './sources/api',
routeBasePath: 'api/v2-new', // TODO change to `api/v2` once we are ready
routeBasePath: 'api/v2',
rehypePlugins: [externalLinkProcessor],
showLastUpdateAuthor: false,
showLastUpdateTime: false,
Expand Down
3 changes: 2 additions & 1 deletion static/robots.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
User-agent: *
Sitemap: https://docs.apify.com/sitemap.xml
Disallow: https://docs.apify.com/api/v2-old
Disallow: https://docs.apify.com/api/v2-new
Disallow: https://docs.apify.com/api/v2-redoc
Disallow: https://docs.apify.com/api/v2

0 comments on commit 41e49b1

Please sign in to comment.