@apify/docs-theme 1.0.16 → 1.0.17
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 +1 -1
- package/src/config.js +0 -3
- package/src/theme/Footer/LinkItem/index.js +40 -0
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -218,14 +218,11 @@ const themeConfig = ({
|
|
|
218
218
|
{
|
|
219
219
|
label: 'Cralwee',
|
|
220
220
|
to: 'https://crawlee.dev',
|
|
221
|
-
target: '_self',
|
|
222
221
|
rel: 'dofollow',
|
|
223
222
|
},
|
|
224
223
|
{
|
|
225
224
|
label: 'GitHub',
|
|
226
225
|
href: 'https://github.com/apify',
|
|
227
|
-
target: '_self',
|
|
228
|
-
rel: 'dofollow',
|
|
229
226
|
},
|
|
230
227
|
],
|
|
231
228
|
},
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Link from '@docusaurus/Link';
|
|
3
|
+
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
4
|
+
import isInternalUrl_ from '@docusaurus/isInternalUrl';
|
|
5
|
+
import IconExternalLink from '@theme/Icon/ExternalLink';
|
|
6
|
+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
7
|
+
|
|
8
|
+
export default function FooterLinkItem({ item }) {
|
|
9
|
+
const {
|
|
10
|
+
to,
|
|
11
|
+
href,
|
|
12
|
+
label,
|
|
13
|
+
prependBaseUrlToHref,
|
|
14
|
+
...props
|
|
15
|
+
} = item;
|
|
16
|
+
const toUrl = useBaseUrl(to);
|
|
17
|
+
const normalizedHref = useBaseUrl(href, { forcePrependBaseUrl: true });
|
|
18
|
+
const { siteConfig } = useDocusaurusContext();
|
|
19
|
+
const isInternalUrl = (url) => {
|
|
20
|
+
if (url.startsWith(siteConfig.url)) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return isInternalUrl_(url);
|
|
24
|
+
};
|
|
25
|
+
return (
|
|
26
|
+
<Link
|
|
27
|
+
className="footer__link-item"
|
|
28
|
+
{...(href
|
|
29
|
+
? {
|
|
30
|
+
href: prependBaseUrlToHref ? normalizedHref : href
|
|
31
|
+
}
|
|
32
|
+
: {
|
|
33
|
+
to: toUrl
|
|
34
|
+
})}
|
|
35
|
+
{...props}>
|
|
36
|
+
{label}
|
|
37
|
+
{href && !isInternalUrl(href) && <IconExternalLink />}
|
|
38
|
+
</Link>
|
|
39
|
+
);
|
|
40
|
+
}
|