Skip to content

Commit d1ee201

Browse files
committed
try to fix CI and remove index page with a redirect
1 parent 2a9dd5a commit d1ee201

File tree

4 files changed

+36
-29
lines changed

4 files changed

+36
-29
lines changed

.github/workflows/docs.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,20 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@v4
21-
- name: Use Node.js 20
21+
- name: Use Node.js 22
2222
uses: actions/setup-node@v4
2323
with:
24-
node-version: 20
24+
node-version: 22
2525
cache: 'npm'
2626
cache-dependency-path: 'package-lock.json'
2727
always-auth: 'true'
2828
registry-url: 'https://npm.pkg.github.com/'
2929
scope: '@apify-packages'
3030

31+
- name: Enable corepack
32+
run: |
33+
corepack enable
34+
3135
- name: Build docs
3236
run: |
3337
npm ci --force

docusaurus.config.js

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ module.exports = {
164164
{
165165
id: 'openapi',
166166
path: './sources/api',
167-
routeBasePath: 'api/v2-new',
167+
routeBasePath: 'api/v2-new', // TODO change to `api/v2` once we are ready
168168
rehypePlugins: [externalLinkProcessor],
169169
showLastUpdateAuthor: false,
170170
showLastUpdateTime: false,
@@ -209,18 +209,22 @@ module.exports = {
209209
},
210210
}),
211211
// TODO this should be somehow computed from all the external sources
212-
// [
213-
// '@docusaurus/plugin-client-redirects',
214-
// {
215-
// createRedirects(existingPath) {
216-
// if (!existingPath.endsWith('/')) {
217-
// return `${existingPath}/`;
218-
// }
219-
//
220-
// return undefined; // Return a falsy value: no redirect created
221-
// },
222-
// },
223-
// ],
212+
[
213+
'@docusaurus/plugin-client-redirects',
214+
{
215+
createRedirects(existingPath) {
216+
// TODO change to `api/v2` once we are ready
217+
if (existingPath.endsWith('api/v2-new')) {
218+
return `${existingPath}/api/v2-new/apify-api`;
219+
}
220+
// if (!existingPath.endsWith('/')) {
221+
// return `${existingPath}/`;
222+
// }
223+
224+
return undefined; // Return a falsy value: no redirect created
225+
},
226+
},
227+
],
224228
...config.plugins,
225229
],
226230
markdown: {

sources/api/sidebars.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ module.exports = {
22
api: [
33
{
44
type: 'category',
5-
label: 'Petstore',
6-
link: {
7-
type: 'generated-index',
8-
title: 'Petstore API',
9-
description:
10-
'This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key special-key to test the authorization filters.',
11-
slug: '/category/petstore-api',
12-
},
5+
label: 'API reference',
6+
// link: {
7+
// type: 'generated-index',
8+
// title: 'API reference',
9+
// description:
10+
// 'This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key special-key to test the authorization filters.',
11+
// slug: '/category/petstore-api',
12+
// },
1313
// eslint-disable-next-line global-require
1414
items: require('./sidebar.ts'),
1515
},

sources/api/webhook-dispatch-get.api.mdx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import Heading from "@theme/Heading";
3131
path={"/v2/webhook-dispatches/{dispatchId}"}
3232
context={"endpoint"}
3333
>
34-
34+
3535
</MethodEndpoint>
3636

3737

@@ -47,25 +47,24 @@ import Heading from "@theme/Heading";
4747
</Heading>
4848

4949
<ParamsDetails
50-
parameters={[{"name":"dispatchId","in":"path","description":"Webhook dispacth ID.","required":true,"style":"simple","schema":{"type":"string","example":"Zib4xbZsmvZeK55ua"}}]}
50+
parameters={[{"name":"dispatchId","in":"path","description":"Webhook dispatch ID.","required":true,"style":"simple","schema":{"type":"string","example":"Zib4xbZsmvZeK55ua"}}]}
5151
>
52-
52+
5353
</ParamsDetails>
5454

5555
<RequestSchema
5656
title={"Body"}
5757
body={undefined}
5858
>
59-
59+
6060
</RequestSchema>
6161

6262
<StatusCodes
6363
id={undefined}
6464
label={undefined}
6565
responses={{"200":{"description":"","headers":{},"content":{"application/json":{"schema":{"title":"GetWebhookDispatchResponse","required":["data"],"type":"object","properties":{"data":{"title":"WebhookDispatch","required":["id","userId","webhookId","createdAt","status","eventType","eventData"],"type":"object","properties":{"id":{"type":"string","example":"asdLZtadYvn4mBZmm"},"userId":{"type":"string","example":"wRsJZtadYvn4mBZmm"},"webhookId":{"type":"string","example":"asdLZtadYvn4mBZmm"},"createdAt":{"type":"string","example":"2019-12-12T07:34:14.202Z"},"status":{"type":"string","example":"SUCCEEDED"},"eventType":{"type":"string","example":"ACTOR.RUN.SUCCEEDED"},"eventData":{"title":"eventData","type":"object","required":["actorId","actorRunId"],"properties":{"actorId":{"type":"string","example":"vvE7iMKuMc5qTHHsR"},"actorRunId":{"type":"string","example":"JgwXN9BdwxGcu9MMF"}}},"calls":{"title":"calls","type":"object","properties":{"startedAt":{"type":"string","nullable":true,"example":"2019-12-12T07:34:14.202Z"},"finishedAt":{"type":"string","nullable":true,"example":"2019-12-12T07:34:14.202Z"},"errorMessage":{"type":"string","nullable":true,"example":"Cannot send request"},"responseStatus":{"type":"number","nullable":true,"example":200},"responseBody":{"type":"string","nullable":true,"example":{"foo":"bar"}}}}}}}}}}}}}
6666
>
67-
67+
6868
</StatusCodes>
6969

7070

71-

0 commit comments

Comments
 (0)