@apify/docs-theme 1.0.17 → 1.0.18

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.17",
3
+ "version": "1.0.18",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "files": [
@@ -1,49 +1,8 @@
1
1
  import React from 'react';
2
- import useBaseUrl from '@docusaurus/useBaseUrl';
3
- import useIsBrowser from '@docusaurus/useIsBrowser';
4
2
  import { PageMetadata } from '@docusaurus/theme-common';
5
- import Link from '@docusaurus/Link';
6
3
  import Layout from '@theme/Layout';
7
4
 
8
5
  export default function NotFound() {
9
- const redirectedV2Url = useBaseUrl('/docs/api');
10
- const redirectedV1Url = useBaseUrl('/docs/1.3.1/api');
11
- const baseUrlForV2Redirect = useBaseUrl(`/docs/2.3/api/`);
12
- const baseUrlForV1Redirect = useBaseUrl(`/docs/1.3/api/`);
13
- const isBrowser = useIsBrowser();
14
-
15
- if (isBrowser) {
16
- const path = window.location.pathname;
17
- let href = '';
18
- let redirect = false;
19
-
20
- if (path.startsWith(redirectedV2Url)) {
21
- href = baseUrlForV2Redirect + path.substring(redirectedV2Url.length + 1);
22
- redirect = true;
23
- }
24
-
25
- if (path.match(/\/docs\/2\.\d+\.\d+\/api/)) {
26
- href = baseUrlForV2Redirect + path.substring(redirectedV1Url.length + 1);
27
- redirect = true;
28
- }
29
-
30
- if (path.match(/\/api\/[12]\.\d+\/\w+/)) {
31
- const [, v, id] = path.match(/\/api\/([12])\.\d+\/(.*)/);
32
- href = (v === '1' ? baseUrlForV1Redirect : baseUrlForV2Redirect) + id;
33
- redirect = true;
34
- }
35
-
36
- if (path.match(/\/docs\/[01]\.\d+\.\d+\/api\/(.*)/)) {
37
- const id = path.match(/\/docs\/[01]\.\d+\.\d+\/api\/(.*)/)[1];
38
- href = baseUrlForV1Redirect + id;
39
- redirect = true;
40
- }
41
-
42
- if (redirect && window.location.href !== href) {
43
- window.location.href = href;
44
- }
45
- }
46
-
47
6
  return (
48
7
  <>
49
8
  <PageMetadata title={'Page Not Found'} />
@@ -57,17 +16,6 @@ export default function NotFound() {
57
16
  <p>
58
17
  We could not find what you were looking for 😢
59
18
  </p>
60
- <p>
61
- Recently we <b>released Apify SDK v3 </b>
62
- and we significantly upgraded the documentation.
63
- </p>
64
- <p>
65
- If you're looking for documentation of <b>Apify SDK v2</b>,
66
- <Link to={'/docs/2.3/guides/apify-platform'}> you can find it here</Link>.
67
- </p>
68
- <p>
69
- For <b>Apify SDK v3 docs</b>, go to the <Link to={'/'}>homepage</Link>.
70
- </p>
71
19
  </div>
72
20
  </div>
73
21
  </main>