forked from TuGraph-family/tugraph-db
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from liukaiming-alipay/faature_lkm
Feat: doc styles
- Loading branch information
Showing
7 changed files
with
363 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React from 'react'; | ||
import Link from '@docusaurus/Link'; | ||
import { translate } from '@docusaurus/Translate'; | ||
|
||
import { useLocation } from '@docusaurus/router'; | ||
|
||
export default function HomeBreadcrumbItem(): JSX.Element { | ||
const { pathname } = useLocation(); | ||
|
||
const homeHref = () => { | ||
try { | ||
const pathSegments = pathname | ||
.split("/") | ||
.filter((segment) => segment !== ""); | ||
|
||
// 截取前三个路径段 | ||
const basePathSegments = pathSegments.slice(0, 3); | ||
const basePath = `/${basePathSegments.join("/")}/guide`; | ||
return basePath; | ||
} catch (error) { | ||
console.error("Invalid URL:", error); | ||
return ""; | ||
} | ||
}; | ||
|
||
return ( | ||
<li className="breadcrumbs__item"> | ||
<Link | ||
aria-label={translate({ | ||
id: 'theme.docs.breadcrumbs.home', | ||
message: 'Home page', | ||
description: 'The ARIA label for the home page in the breadcrumbs', | ||
})} | ||
className="breadcrumbs__link" | ||
|
||
href={homeHref()}> | ||
<div style={{ color: '#1a1b2572' }}> | ||
文档 | ||
</div> | ||
</Link> | ||
</li> | ||
); | ||
} |
Oops, something went wrong.