@apify/docs-theme 1.0.267 → 1.0.269

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.267",
3
+ "version": "1.0.269",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "files": [
@@ -22,7 +22,7 @@
22
22
  "@apify/docs-search-modal": "^1.4.0",
23
23
  "@apify/ui-icons": "^1.19.0",
24
24
  "@apify/ui-library": "^1.156.1",
25
- "@docusaurus/theme-common": "^3.7.0",
25
+ "@docusaurus/theme-common": "^3.10.2",
26
26
  "@stackql/docusaurus-plugin-hubspot": "^1.1.0",
27
27
  "algoliasearch": "^5.19.0",
28
28
  "algoliasearch-helper": "^3.22.6",
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: [
160
+ {
161
+ label: 'SDK for JavaScript',
162
+ href: `${absoluteUrl}/sdk/js/docs/overview`,
163
+ target: '_self',
164
+ rel: 'dofollow',
165
+ },
134
166
  {
135
- label: 'Experimental client for Go',
136
- href: `https://github.com/apify/apify-client-go`,
167
+ label: 'SDK for Python',
168
+ href: `${absoluteUrl}/sdk/python/docs/overview`,
137
169
  target: '_self',
138
170
  rel: 'dofollow',
139
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: [
140
184
  {
141
- label: 'Experimental client for PHP',
142
- href: `https://github.com/apify/apify-client-php`,
185
+ label: 'Installation',
186
+ href: `${absoluteUrl}/cli/docs/installation`,
143
187
  target: '_self',
144
188
  rel: 'dofollow',
145
189
  },
146
190
  {
147
- label: 'Experimental client for Java',
148
- href: `https://github.com/apify/apify-client-java`,
191
+ label: 'Quick start',
192
+ href: `${absoluteUrl}/cli/docs/quick-start`,
149
193
  target: '_self',
150
194
  rel: 'dofollow',
151
195
  },
152
196
  {
153
- label: 'Experimental client for .NET',
154
- href: `https://github.com/apify/apify-client-dotnet`,
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: {
@@ -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;