@apify/docs-theme 1.0.266 → 1.0.268

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/docs-theme",
3
- "version": "1.0.266",
3
+ "version": "1.0.268",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "files": [
package/src/config.js CHANGED
@@ -83,80 +83,132 @@ const themeConfig = {
83
83
  target: '_self',
84
84
  rel: 'dofollow',
85
85
  },
86
+ // The dropdown labels below carry both `href` and `to` on purpose. `href` keeps the
87
+ // target absolute, so the link resolves from the client, SDK, and CLI docs sites as
88
+ // well. `to` tells the Docusaurus dropdown that the label is a real link, so clicking
89
+ // it opens the landing page instead of only toggling the menu open.
86
90
  {
87
- label: 'APIs, SDKs & CLI',
91
+ label: 'API',
88
92
  type: 'dropdown',
89
- activeBaseRegex: '^/(api|sdk|cli)/',
93
+ href: `${absoluteUrl}/api`,
94
+ to: `${absoluteUrl}/api`,
95
+ activeBaseRegex: '^/api(/|$)',
90
96
  position: 'right',
97
+ target: '_self',
98
+ rel: 'dofollow',
91
99
  items: [
92
100
  {
93
- label: 'API Reference',
101
+ label: 'API reference',
94
102
  href: `${absoluteUrl}/api/v2`,
95
103
  target: '_self',
96
104
  rel: 'dofollow',
97
105
  },
98
106
  {
99
- label: 'SDK for JavaScript',
100
- href: `${absoluteUrl}/sdk/js/docs/overview`,
107
+ label: 'Client for JavaScript',
108
+ href: `${absoluteUrl}/api/client/js/docs`,
101
109
  target: '_self',
102
110
  rel: 'dofollow',
103
111
  },
104
112
  {
105
- label: 'SDK for Python',
106
- href: `${absoluteUrl}/sdk/python/docs/overview`,
113
+ label: 'Client for Python',
114
+ href: `${absoluteUrl}/api/client/python/docs`,
107
115
  target: '_self',
108
116
  rel: 'dofollow',
109
117
  },
110
118
  {
111
- label: 'Client for JavaScript',
112
- href: `${absoluteUrl}/api/client/js/docs`,
119
+ label: 'Client for Go',
120
+ href: `https://github.com/apify/apify-client-go`,
113
121
  target: '_self',
114
122
  rel: 'dofollow',
115
123
  },
116
124
  {
117
- label: 'Client for Python',
118
- href: `${absoluteUrl}/api/client/python/docs`,
125
+ label: 'Client for PHP',
126
+ href: `https://github.com/apify/apify-client-php`,
119
127
  target: '_self',
120
128
  rel: 'dofollow',
121
129
  },
122
130
  {
123
- label: 'CLI',
124
- href: `${absoluteUrl}/cli/docs`,
131
+ label: 'Client for Java',
132
+ href: `https://github.com/apify/apify-client-java`,
133
+ target: '_self',
134
+ rel: 'dofollow',
135
+ },
136
+ {
137
+ label: 'Client for .NET',
138
+ href: `https://github.com/apify/apify-client-dotnet`,
125
139
  target: '_self',
126
140
  rel: 'dofollow',
127
141
  },
128
142
  {
129
- label: 'Experimental client for Rust',
143
+ label: 'Client for Rust',
130
144
  href: `https://github.com/apify/apify-client-rust`,
131
145
  target: '_self',
132
146
  rel: 'dofollow',
133
147
  },
148
+ ],
149
+ },
150
+ {
151
+ label: 'SDK',
152
+ type: 'dropdown',
153
+ href: `${absoluteUrl}/sdk`,
154
+ to: `${absoluteUrl}/sdk`,
155
+ activeBaseRegex: '^/sdk(/|$)',
156
+ position: 'right',
157
+ target: '_self',
158
+ rel: 'dofollow',
159
+ items: [
134
160
  {
135
- label: 'Experimental client for Go',
136
- href: `https://github.com/apify/apify-client-go`,
161
+ label: 'SDK for JavaScript',
162
+ href: `${absoluteUrl}/sdk/js/docs/overview`,
137
163
  target: '_self',
138
164
  rel: 'dofollow',
139
165
  },
140
166
  {
141
- label: 'Experimental client for PHP',
142
- href: `https://github.com/apify/apify-client-php`,
167
+ label: 'SDK for Python',
168
+ href: `${absoluteUrl}/sdk/python/docs/overview`,
143
169
  target: '_self',
144
170
  rel: 'dofollow',
145
171
  },
172
+ ],
173
+ },
174
+ {
175
+ label: 'CLI',
176
+ type: 'dropdown',
177
+ href: `${absoluteUrl}/cli`,
178
+ to: `${absoluteUrl}/cli`,
179
+ activeBaseRegex: '^/cli(/|$)',
180
+ position: 'right',
181
+ target: '_self',
182
+ rel: 'dofollow',
183
+ items: [
146
184
  {
147
- label: 'Experimental client for Java',
148
- href: `https://github.com/apify/apify-client-java`,
185
+ label: 'Installation',
186
+ href: `${absoluteUrl}/cli/docs/installation`,
149
187
  target: '_self',
150
188
  rel: 'dofollow',
151
189
  },
152
190
  {
153
- label: 'Experimental client for .NET',
154
- href: `https://github.com/apify/apify-client-dotnet`,
191
+ label: 'Quick start',
192
+ href: `${absoluteUrl}/cli/docs/quick-start`,
193
+ target: '_self',
194
+ rel: 'dofollow',
195
+ },
196
+ {
197
+ label: 'Command reference',
198
+ href: `${absoluteUrl}/cli/docs/reference`,
155
199
  target: '_self',
156
200
  rel: 'dofollow',
157
201
  },
158
202
  ],
159
203
  },
204
+ {
205
+ label: 'MCP',
206
+ href: `${absoluteUrl}/integrations/mcp`,
207
+ activeBasePath: 'integrations/mcp',
208
+ position: 'right',
209
+ target: '_self',
210
+ rel: 'dofollow',
211
+ },
160
212
  ],
161
213
  },
162
214
  colorMode: {
@@ -175,34 +227,23 @@ const themeConfig = {
175
227
  footer: {
176
228
  links: [
177
229
  {
178
- title: 'Learn',
230
+ title: 'Reference',
179
231
  items: [
180
232
  {
181
- label: 'Academy',
182
- href: `${absoluteUrl}/academy`,
183
- target: '_self',
184
- rel: 'dofollow',
185
- },
186
- {
187
- label: 'Get started',
188
- href: `${absoluteUrl}/get-started`,
233
+ label: 'API Reference',
234
+ href: `${absoluteUrl}/api/v2`,
189
235
  target: '_self',
190
236
  rel: 'dofollow',
191
237
  },
192
238
  {
193
- label: 'Actors',
194
- href: `${absoluteUrl}/actors`,
239
+ label: 'SDK for JavaScript',
240
+ href: `${absoluteUrl}/sdk/js/docs/overview`,
195
241
  target: '_self',
196
242
  rel: 'dofollow',
197
243
  },
198
- ],
199
- },
200
- {
201
- title: 'API',
202
- items: [
203
244
  {
204
- label: 'Reference',
205
- href: `${absoluteUrl}/api/v2`,
245
+ label: 'SDK for Python',
246
+ href: `${absoluteUrl}/sdk/python/docs/overview`,
206
247
  target: '_self',
207
248
  rel: 'dofollow',
208
249
  },
@@ -218,20 +259,9 @@ const themeConfig = {
218
259
  target: '_self',
219
260
  rel: 'dofollow',
220
261
  },
221
- ],
222
- },
223
- {
224
- title: 'SDK',
225
- items: [
226
- {
227
- label: 'SDK for JavaScript',
228
- href: `${absoluteUrl}/sdk/js/docs/overview`,
229
- target: '_self',
230
- rel: 'dofollow',
231
- },
232
262
  {
233
- label: 'SDK for Python',
234
- href: `${absoluteUrl}/sdk/python/docs/overview`,
263
+ label: 'CLI',
264
+ href: `${absoluteUrl}/cli/docs`,
235
265
  target: '_self',
236
266
  rel: 'dofollow',
237
267
  },
@@ -265,49 +295,64 @@ const themeConfig = {
265
295
  label: 'proxy-chain',
266
296
  href: 'https://github.com/apify/proxy-chain',
267
297
  },
298
+ ],
299
+ },
300
+ {
301
+ title: 'Security',
302
+ items: [
268
303
  {
269
- label: 'Apify on GitHub',
270
- href: 'https://github.com/apify',
304
+ label: 'Trust Center',
305
+ href: 'https://trust.apify.com',
271
306
  },
272
307
  ],
273
308
  },
274
309
  {
275
- title: 'Other',
310
+ title: 'Community',
276
311
  items: [
277
312
  {
278
- label: 'CLI',
279
- href: `${absoluteUrl}/cli/docs`,
280
- position: 'left',
281
- target: '_self',
282
- rel: 'dofollow',
313
+ label: 'Discord',
314
+ href: 'https://discord.com/invite/jyEM2PRvMU',
283
315
  },
284
316
  {
285
- label: 'llms.txt',
286
- href: `${absoluteUrl}/llms.txt`,
287
- target: '_self',
288
- rel: 'dofollow',
317
+ label: 'X',
318
+ href: 'https://x.com/apify',
319
+ },
320
+ {
321
+ label: 'YouTube',
322
+ href: 'https://www.youtube.com/c/Apify',
323
+ },
324
+ {
325
+ label: 'GitHub',
326
+ href: 'https://github.com/apify',
289
327
  },
290
328
  ],
291
329
  },
292
330
  {
293
- title: 'More',
331
+ title: 'For AI',
294
332
  items: [
295
333
  {
296
- label: 'Crawlee',
297
- to: 'https://crawlee.dev',
334
+ label: 'llms.txt',
335
+ href: `${absoluteUrl}/llms.txt`,
336
+ target: '_self',
298
337
  rel: 'dofollow',
299
338
  },
300
339
  {
301
- label: 'GitHub',
302
- href: 'https://github.com/apify',
340
+ label: 'llms-full.txt',
341
+ href: `${absoluteUrl}/llms-full.txt`,
342
+ target: '_self',
343
+ rel: 'dofollow',
303
344
  },
304
345
  {
305
- href: 'https://discord.com/invite/jyEM2PRvMU',
306
- label: 'Discord',
346
+ label: 'OpenAPI (JSON)',
347
+ href: `${absoluteUrl}/api/openapi.json`,
348
+ target: '_self',
349
+ rel: 'dofollow',
307
350
  },
308
351
  {
309
- label: 'Trust Center',
310
- href: 'https://trust.apify.com',
352
+ label: 'OpenAPI (YAML)',
353
+ href: `${absoluteUrl}/api/openapi.yaml`,
354
+ target: '_self',
355
+ rel: 'dofollow',
311
356
  },
312
357
  ],
313
358
  },
@@ -6,11 +6,14 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
6
6
  import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
7
7
  import { usePluginData } from '@docusaurus/useGlobalData';
8
8
  import IconExternalLink from '@theme/Icon/ExternalLink';
9
+ import clsx from 'clsx';
9
10
  import React from 'react';
10
11
 
11
12
  export default function NavbarNavLink({
12
13
  activeBasePath,
13
14
  activeBaseRegex,
15
+ activeClassName = 'navbar__link--active',
16
+ className,
14
17
  to,
15
18
  href,
16
19
  label,
@@ -30,7 +33,6 @@ export default function NavbarNavLink({
30
33
  // TODO all this seems hacky
31
34
  // {to: 'version'} should probably be forbidden, in favor of {to: '/version'}
32
35
  const toUrl = useBaseUrl(to);
33
- const activeBaseUrl = useBaseUrl(activeBasePath);
34
36
  const normalizedHref = useBaseUrl(href, { forcePrependBaseUrl: true });
35
37
  const { siteConfig } = useDocusaurusContext();
36
38
  const isInternalUrl = (url) => {
@@ -63,16 +65,18 @@ export default function NavbarNavLink({
63
65
  .some((item) => (item.to || item.href).endsWith(location.pathname));
64
66
 
65
67
  if (href) {
68
+ // `Link` drops `isActive`/`activeClassName` for absolute URLs (they only work with the
69
+ // React Router link), so the active class has to be resolved here instead.
70
+ const isActive =
71
+ (activeBaseRegex && isRegexpStringMatch(activeBaseRegex, location.pathname)) ||
72
+ (activeBasePath && location.pathname.startsWith(`/${activeBasePath}`)) ||
73
+ dropDownHasActiveItem;
74
+
66
75
  return (
67
76
  <Link
68
77
  href={prependBaseUrlToHref ? normalizedHref : href}
69
78
  {...props}
70
- {...(activeBaseUrl && {
71
- className:
72
- location.pathname.startsWith(`/${activeBasePath}`) || dropDownHasActiveItem
73
- ? 'navbar__item navbar__link navbar__link--active'
74
- : 'navbar__item navbar__link',
75
- })}
79
+ className={clsx(className, isActive && activeClassName)}
76
80
  {...linkContentProps}
77
81
  />
78
82
  );
@@ -82,13 +86,14 @@ export default function NavbarNavLink({
82
86
  <Link
83
87
  to={toUrl}
84
88
  isNavLink
89
+ className={className}
85
90
  {...((activeBasePath || activeBaseRegex) && {
86
91
  // eslint-disable-next-line no-shadow
87
92
  isActive: (_match, location) =>
88
93
  activeBaseRegex
89
94
  ? isRegexpStringMatch(activeBaseRegex, location.pathname) || dropDownHasActiveItem
90
95
  : location.pathname.startsWith(`/${activeBasePath}`),
91
- activeClassName: 'navbar__link--active',
96
+ activeClassName,
92
97
  })}
93
98
  {...props}
94
99
  {...linkContentProps}
@@ -997,6 +997,18 @@ div[class*='searchBox'] {
997
997
  }
998
998
  }
999
999
 
1000
+ /*
1001
+ * Just above the mobile breakpoint the two halves of the nav link row run out of room and
1002
+ * collide. The switch to the mobile sidebar is pinned to 996px in Docusaurus (both Infima
1003
+ * and the JS `useWindowSize`), so the row has to fit down to that width instead: tighten
1004
+ * the spacing between the right-hand links until the layout has room again.
1005
+ */
1006
+ @media (min-width: 997px) and (max-width: 1100px) {
1007
+ .navbar__inner--subnavbar .navbar__items--right {
1008
+ gap: 0.4rem;
1009
+ }
1010
+ }
1011
+
1000
1012
  /* @media (min-width: 997px) and (max-width: 1250px) {
1001
1013
  .navbar__items--right a.icon {
1002
1014
  display: none;