@apify/docs-theme 1.0.30 → 1.0.31

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.30",
3
+ "version": "1.0.31",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "files": [
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import Link from '@docusaurus/Link';
3
+ import useBaseUrl from '@docusaurus/useBaseUrl';
4
+ import { useLocation } from '@docusaurus/router';
5
+ import { translate } from '@docusaurus/Translate';
6
+ import IconHome from '@theme/Icon/Home';
7
+ import styles from './styles.module.css';
8
+
9
+ export default function HomeBreadcrumbItem() {
10
+ const baseUrl = useBaseUrl('/');
11
+
12
+ const currentPath = useLocation().pathname.replace(`^${baseUrl}`, '');
13
+ const homeHref = useBaseUrl(currentPath.split('/')[1]);
14
+
15
+ return (
16
+ <li className="breadcrumbs__item">
17
+ <Link
18
+ aria-label={translate({
19
+ id: 'theme.docs.breadcrumbs.home',
20
+ message: 'Home page',
21
+ description: 'The ARIA label for the home page in the breadcrumbs',
22
+ })}
23
+ className="breadcrumbs__link"
24
+ href={homeHref}>
25
+ <IconHome className={styles.breadcrumbHomeIcon} />
26
+ </Link>
27
+ </li>
28
+ );
29
+ }
@@ -0,0 +1,7 @@
1
+ .breadcrumbHomeIcon {
2
+ position: relative;
3
+ top: 1px;
4
+ vertical-align: top;
5
+ height: 1.1rem;
6
+ width: 1.1rem;
7
+ }