@apify/docs-theme 1.0.31 → 1.0.32

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.31",
3
+ "version": "1.0.32",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "files": [
@@ -27,10 +27,10 @@ export default function FooterLinkItem({ item }) {
27
27
  className="footer__link-item"
28
28
  {...(href
29
29
  ? {
30
- href: prependBaseUrlToHref ? normalizedHref : href
30
+ href: prependBaseUrlToHref ? normalizedHref : href,
31
31
  }
32
32
  : {
33
- to: toUrl
33
+ to: toUrl,
34
34
  })}
35
35
  {...props}>
36
36
  {label}
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
2
  import Link from '@docusaurus/Link';
3
3
  import useBaseUrl from '@docusaurus/useBaseUrl';
4
- import isInternalUrl from '@docusaurus/isInternalUrl';
4
+ import isInternalUrl_ from '@docusaurus/isInternalUrl';
5
+ import IconExternalLink from '@theme/Icon/ExternalLink';
5
6
  import { useLocation } from '@docusaurus/router';
6
7
  import { isRegexpStringMatch, useThemeConfig } from '@docusaurus/theme-common';
7
8
  import { usePluginData } from '@docusaurus/useGlobalData';
9
+ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
8
10
 
9
11
  export default function NavbarNavLink({
10
12
  activeBasePath,
@@ -26,8 +28,15 @@ export default function NavbarNavLink({
26
28
  const toUrl = useBaseUrl(to);
27
29
  const activeBaseUrl = useBaseUrl(activeBasePath);
28
30
  const normalizedHref = useBaseUrl(href, { forcePrependBaseUrl: true });
29
- // const isExternalLink = label && href && !isInternalUrl(href);
30
- const isExternalLink = false;
31
+ const { siteConfig } = useDocusaurusContext();
32
+ const isInternalUrl = (url) => {
33
+ if (url.startsWith(siteConfig.url)) {
34
+ return true;
35
+ }
36
+ return isInternalUrl_(url);
37
+ };
38
+
39
+ const isExternalLink = label && href && !isInternalUrl(href);
31
40
  // Link content is set through html XOR label
32
41
  const linkContentProps = html
33
42
  ? { dangerouslySetInnerHTML: { __html: html } }
@@ -245,8 +245,8 @@ html[data-theme="dark"] .navbar .navbar__link[href*=discord]:before {
245
245
  background-image: url('/img/discord-brand-dark.svg');
246
246
  }
247
247
 
248
- .navbar svg[class*=iconExternalLink],
249
- aside svg[class*=iconExternalLink] {
248
+ .navbar .icon svg[class*=iconExternalLink],
249
+ aside .icon svg[class*=iconExternalLink] {
250
250
  display: none;
251
251
  }
252
252