Skip to content

Commit

Permalink
Merge pull request #10 from liukaiming-alipay/doc_lkm
Browse files Browse the repository at this point in the history
feat: remove tugraph db version
  • Loading branch information
zhongyunWan authored Dec 12, 2024
2 parents 9ea77cf + e471372 commit e829f2a
Show file tree
Hide file tree
Showing 1,111 changed files with 771 additions and 95,696 deletions.
65 changes: 13 additions & 52 deletions docs/docusaurus/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ const config: Config = {
// routeBasePath: "zh/latest",
// },
docs: {
id: "4-5-0_zh",
sidebarPath: "./versions_sidebars/version-4.5.0_zh.ts",
path: "./versions/version-4.5.0/zh-CN/source",
routeBasePath: "zh/4.5.0",
id: "4-5-1_zh",
sidebarPath: "./versions_sidebars/version-4.5.1_zh.ts",
path: "./versions/version-4.5.1/zh-CN/source",
routeBasePath: "zh/4.5.1",
},
theme: {
customCss: "./src/css/custom.css",
Expand All @@ -72,10 +72,10 @@ const config: Config = {
[
"content-docs",
{
id: "4-5-0_en",
sidebarPath: "./versions_sidebars/version-4.5.0_en.ts",
path: "./versions/version-4.5.0/en-US/source",
routeBasePath: "en/4.5.0",
id: "4-5-1_en",
sidebarPath: "./versions_sidebars/version-4.5.1_en.ts",
path: "./versions/version-4.5.1/en-US/source",
routeBasePath: "en/4.5.1",
editCurrentVersion: false,
} satisfies DocsOptions,
],
Expand Down Expand Up @@ -199,26 +199,7 @@ const config: Config = {
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "4-0-0_en",
sidebarPath: "./versions_sidebars/version-4.0.0_en.ts",
path: "./versions/version-4.0.0/en-US/source",
routeBasePath: "en/4.0.0",
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "4-0-0_zh",
sidebarPath: "./versions_sidebars/version-4.0.0_zh.ts",
path: "./versions/version-4.0.0/zh-CN/source",
routeBasePath: "zh/4.0.0",
editCurrentVersion: false,
} satisfies DocsOptions,
],

[
"content-docs",
{
Expand Down Expand Up @@ -259,26 +240,6 @@ const config: Config = {
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "3-5-0_en",
sidebarPath: "./versions_sidebars/version-3.5.0_en.ts",
path: "./versions/version-3.5.0/en-US/source",
routeBasePath: "en/3.5.0",
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "3-5-0_zh",
sidebarPath: "./versions_sidebars/version-3.5.0_zh.ts",
path: "./versions/version-3.5.0/zh-CN/source",
routeBasePath: "zh/3.5.0",
editCurrentVersion: false,
} satisfies DocsOptions,
],
],

themeConfig: {
Expand Down Expand Up @@ -313,12 +274,12 @@ const config: Config = {

headTags: [
{
tagName: 'meta',
tagName: "meta",
attributes: {
name: 'algolia-site-verification',
content: 'FC204AA054194DE3',
name: "algolia-site-verification",
content: "FC204AA054194DE3",
},
}
},
],
};

Expand Down
14 changes: 1 addition & 13 deletions docs/docusaurus/src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,15 @@ const ZH_NOT_FOUND_CONFIG = {
};

const versions = [
"4.5.0",
"4.5.1",
"4.3.2",
"4.3.1",
"4.3.0",
"4.2.0",
"4.1.0",
"4.0.1",
"4.0.0",
"3.6.0",
"3.5.1",
"3.5.0",
];

const EN_DOC_OPTIONS = [
Expand All @@ -130,11 +128,6 @@ const EN_DOC_OPTIONS = [
label: "TuGraph Analytics Streaming Graph Computing Engine",
value: "TuGraph_Analytics",
},
{
label: "TuGraph Learn Graph Learning Engine",
value: "TuGraph_Learn",
children: versions.slice(0, 5).map((item) => ({ value: item, label: item })),
},
];

const ZH_DOC_OPTIONS = [
Expand All @@ -147,11 +140,6 @@ const ZH_DOC_OPTIONS = [
label: "TuGraph Analytics 实时图计算引擎",
value: "TuGraph_Analytics",
},
{
label: "TuGraph Learn 图学习引擎",
value: "TuGraph_Learn",
children: versions.slice(0, 5).map((item) => ({ value: item, label: item })),
},
];

export {
Expand Down
30 changes: 17 additions & 13 deletions docs/docusaurus/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
import clsx from 'clsx';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import Layout from '@theme/Layout';
import HomepageFeatures from '@site/src/components/HomepageFeatures';
import Heading from '@theme/Heading';
import clsx from "clsx";
import Link from "@docusaurus/Link";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import Layout from "@theme/Layout";
import HomepageFeatures from "@site/src/components/HomepageFeatures";
import Heading from "@theme/Heading";

import styles from './index.module.css';
import styles from "./index.module.css";

function HomepageHeader() {
const {siteConfig} = useDocusaurusContext();
const { siteConfig } = useDocusaurusContext();
return (
<header className={clsx('hero', styles.heroBanner)}>
<header className={clsx("hero", styles.heroBanner)}>
<div className="container">
<Heading as="h1" className="hero__title">
{siteConfig.title}
</Heading>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons}>
<Link
className={clsx("button button--secondary button--lg", styles.getStartedBtn)}
to="/zh/4.5.0/guide"
className={clsx(
"button button--secondary button--lg",
styles.getStartedBtn
)}
to="/zh/4.5.1/guide"
>
Get Started
</Link>
Expand All @@ -30,11 +33,12 @@ function HomepageHeader() {
}

export default function Home(): JSX.Element {
const {siteConfig} = useDocusaurusContext();
const { siteConfig } = useDocusaurusContext();
return (
<Layout
title={`Hello from ${siteConfig.title}`}
description="Description will go into a meta tag in <head />">
description="Description will go into a meta tag in <head />"
>
<HomepageHeader />
<main>
<HomepageFeatures />
Expand Down
42 changes: 10 additions & 32 deletions docs/docusaurus/src/theme/DocSidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,15 @@ export default function DocSidebarWrapper(props: Props): JSX.Element {
const { pathname } = location;
const languages = ["en", "zh"];
const versions = [
"4.5.0",
"4.5.1",
"4.3.2",
"4.3.1",
"4.3.0",
"4.2.0",
"4.1.0",
"4.0.1",
"4.0.0",
"3.6.0",
"3.5.1",
"3.5.0",
];

const getCurrentLanguage = () => {
Expand All @@ -50,7 +48,7 @@ export default function DocSidebarWrapper(props: Props): JSX.Element {
) {
return { label: segments[versionIndex], value: segments[versionIndex] };
}
return { label: "4.5.0", value: "4.5.0" };
return { label: "4.5.1", value: "4.5.1" };
};

const formatDocSearchVersion = (tag: string) => {
Expand Down Expand Up @@ -96,12 +94,6 @@ export default function DocSidebarWrapper(props: Props): JSX.Element {
history.push(newPath);
};

const getCurrentType = () => {
return pathname.includes("/olap&procedure/learn")
? "TuGraph_Learn"
: "TuGraph_DB";
};

const navigator = useRef({
navigate({ itemUrl }: { itemUrl?: string }) {
history.push(itemUrl!);
Expand Down Expand Up @@ -153,21 +145,10 @@ export default function DocSidebarWrapper(props: Props): JSX.Element {
};

const getDescByLanguage = (lang: string) => {
const type = getCurrentType();
const desc =
type === "TuGraph_Learn"
? {
zh: "图学习引擎",
en: "Graph Learning Engine",
}
: {
zh: "社区版",
en: "Community",
};
if (lang === "zh") {
return desc.zh;
return "社区版";
}
return desc.en;
return "Community";
};

const getOptions = (lang: string) => {
Expand Down Expand Up @@ -214,12 +195,6 @@ export default function DocSidebarWrapper(props: Props): JSX.Element {
};
}, []);

const getCascaderTitle = () => {
const type = getCurrentType();

return type === "TuGraph_Learn" ? "TuGraph Learn" : "TuGraph DB";
};

return (
<div
className="docsearch-wrapper"
Expand All @@ -238,13 +213,13 @@ export default function DocSidebarWrapper(props: Props): JSX.Element {
>
<Cascader
allowClear={false}
value={[getCurrentType(), getCurrentVersion()?.label]}
value={["TuGraph_DB", getCurrentVersion()?.label]}
options={getOptions(getCurrentLanguage())}
onChange={onVersionChange}
>
<div className="itemWrapper">
<div className="titleBlock">
<span className="titleText">{getCascaderTitle()}</span>
<span className="titleText">TuGraph DB</span>
<div className="downIcon" />
</div>
<div className="contentArea">
Expand All @@ -258,7 +233,10 @@ export default function DocSidebarWrapper(props: Props): JSX.Element {
</div>
</Cascader>

<Tooltip title={getPlaceholderByLanguage(getCurrentLanguage())} trigger={['hover', 'click']} >
<Tooltip
title={getPlaceholderByLanguage(getCurrentLanguage())}
trigger={["hover", "click"]}
>
<div className="searchWrapper">
<DocSearch
{...{
Expand Down
Loading

0 comments on commit e829f2a

Please sign in to comment.