Skip to content

Commit

Permalink
feat: add docusaurus docs (#798)
Browse files Browse the repository at this point in the history
* feat: init Dinosaurs config

* feat: add github workflow config file

* feat: modify github workflow config file

* feat: modify github workflow config file

* feat: modify github workflow config file1

* feat: add en version

* feat: mapping zh folder

* feat: zh doc use custom siderbar config

* feat: update tugraph theme

* feat: modify product url

* feat: test pandoc install

* feat: adapt rst to html

* add multi version by docusaurus'

* bug: fix router config

* feat: add postMessage

* feat: reset docusaurus config

* feat: Version migration

* feat: update zh doc(4.5.0/4.3.2/4.3.1)

* feat: add doc search

* feat: add doc search again

* feat: refix doc search config

* feat: improve search ue

* update zh doc(all)

* feat: modify default version

* feat: modify default version

* feat: modify docsearch

* feat: Chinese document search

* feat: add algolia 版本

* feat: modify 404 html

* feat: Custom 404 page

* feat: opt doc select version render

* feat: Document style

* feat: doc jump

* feat: style add important

* feat: font-size

* feat: TuGraph_Analytics url

* feat: doc styles

* feat: desc color

* feat: delete test code

* feat: remove rc-cascader

* fix: style bug

* feat: reslove rst to html

* feat: modify node memory limit

* feat: doc style

* feat: doc style

* feat: modifu file construct

* feat: delete rest file

* feat: opt version logic

* bug: fix workflow path

* feat: modify docs postmsg logic

* feat: doc padding

* feat: opt docs style

* feat: add TuGraph_Learn check

* feat: menu color

* feat: remove tugraph db version

---------

Co-authored-by: liukaiming-alipay <[email protected]>
Co-authored-by: lipanpan03 <[email protected]>
Co-authored-by: Wang Zhiyong <[email protected]>
  • Loading branch information
4 people authored Dec 13, 2024
1 parent 1ebfbf3 commit b33365b
Show file tree
Hide file tree
Showing 3,459 changed files with 458,472 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
26 changes: 26 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build and Deploy
on: [push]
permissions:
contents: write
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Install Pandoc
run: sudo apt-get update && sudo apt-get install -y pandoc && pandoc --version

- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
export NODE_OPTIONS="--max_old_space_size=8192"
cd docs/docusaurus
yarn install
yarn build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/docusaurus/build # The folder the action should deploy.
21 changes: 21 additions & 0 deletions docs/docusaurus/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Dependencies
/node_modules

# Production
/build
/docs

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions docs/docusaurus/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions docs/docusaurus/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
286 changes: 286 additions & 0 deletions docs/docusaurus/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,286 @@
import { themes as prismThemes } from "prism-react-renderer";
import type { Config } from "@docusaurus/types";
import type { Options as DocsOptions } from "@docusaurus/plugin-content-docs";
import type * as Preset from "@docusaurus/preset-classic";

const config: Config = {
title: "TuGraph 文档中心",
tagline:
"高性能图数据库TuGraph由蚂蚁集团和清华大学共同研发,历经蚂蚁实际业务场景锤炼,在国际图数据库基准测试中获得性能第一",
favicon:
"https://mdn.alipayobjects.com/huamei_qcdryc/afts/img/A*AbamQ5lxv0IAAAAAAAAAAAAADgOBAQ/original",

// Set the production url of your site here
url: "https://tugraph.tech/",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/tugraph-db",

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "facebook", // Usually your GitHub org/user name.
projectName: "Tugraph Docs", // Usually your repo name.

onBrokenLinks: "warn",
onBrokenMarkdownLinks: "warn",
onBrokenAnchors: "warn",

trailingSlash: false,

markdown: {
format: "md",
mermaid: true,
},

i18n: {
defaultLocale: "zh-CN",
locales: ["zh-CN", "en-US"],
},

presets: [
[
"classic",
{
// docs: {
// sidebarPath: "./sidebars.ts",
// path: "../docs/zh-CN/source",
// routeBasePath: "zh/latest",
// },
docs: {
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",
},
} satisfies Preset.Options,
],
],

plugins: [
// [
// "content-docs",
// {
// id: "latest-en",
// sidebarPath: "./sidebarsEn.ts",
// path: "../docs/en-US/source",
// routeBasePath: "en/latest",
// } satisfies DocsOptions,
// ],
[
"content-docs",
{
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,
],
[
"content-docs",
{
id: "4-3-2_en",
sidebarPath: "./versions_sidebars/version-4.3.2_en.ts",
path: "./versions/version-4.3.2/en-US/source",
routeBasePath: "en/4.3.2",
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "4-3-2_zh",
sidebarPath: "./versions_sidebars/version-4.3.2_zh.ts",
path: "./versions/version-4.3.2/zh-CN/source",
routeBasePath: "zh/4.3.2",
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "4-3-1_en",
sidebarPath: "./versions_sidebars/version-4.3.1_en.ts",
path: "./versions/version-4.3.1/en-US/source",
routeBasePath: "en/4.3.1",
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "4-3-1_zh",
sidebarPath: "./versions_sidebars/version-4.3.1_zh.ts",
path: "./versions/version-4.3.1/zh-CN/source",
routeBasePath: "zh/4.3.1",
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "4-3-0_en",
sidebarPath: "./versions_sidebars/version-4.3.0_en.ts",
path: "./versions/version-4.3.0/en-US/source",
routeBasePath: "en/4.3.0",
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "4-3-0_zh",
sidebarPath: "./versions_sidebars/version-4.3.0_zh.ts",
path: "./versions/version-4.3.0/zh-CN/source",
routeBasePath: "zh/4.3.0",
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "4-2-0_en",
sidebarPath: "./versions_sidebars/version-4.2.0_en.ts",
path: "./versions/version-4.2.0/en-US/source",
routeBasePath: "en/4.2.0",
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "4-2-0_zh",
sidebarPath: "./versions_sidebars/version-4.2.0_zh.ts",
path: "./versions/version-4.2.0/zh-CN/source",
routeBasePath: "zh/4.2.0",
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "4-1-0_en",
sidebarPath: "./versions_sidebars/version-4.1.0_en.ts",
path: "./versions/version-4.1.0/en-US/source",
routeBasePath: "en/4.1.0",
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "4-1-0_zh",
sidebarPath: "./versions_sidebars/version-4.1.0_zh.ts",
path: "./versions/version-4.1.0/zh-CN/source",
routeBasePath: "zh/4.1.0",
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "4-0-1_en",
sidebarPath: "./versions_sidebars/version-4.0.1_en.ts",
path: "./versions/version-4.0.1/en-US/source",
routeBasePath: "en/4.0.1",
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "4-0-1_zh",
sidebarPath: "./versions_sidebars/version-4.0.1_zh.ts",
path: "./versions/version-4.0.1/zh-CN/source",
routeBasePath: "zh/4.0.1",
editCurrentVersion: false,
} satisfies DocsOptions,
],

[
"content-docs",
{
id: "3-6-0_en",
sidebarPath: "./versions_sidebars/version-3.6.0_en.ts",
path: "./versions/version-3.6.0/en-US/source",
routeBasePath: "en/3.6.0",
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "3-6-0_zh",
sidebarPath: "./versions_sidebars/version-3.6.0_zh.ts",
path: "./versions/version-3.6.0/zh-CN/source",
routeBasePath: "zh/3.6.0",
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "3-5-1_en",
sidebarPath: "./versions_sidebars/version-3.5.1_en.ts",
path: "./versions/version-3.5.1/en-US/source",
routeBasePath: "en/3.5.1",
editCurrentVersion: false,
} satisfies DocsOptions,
],
[
"content-docs",
{
id: "3-5-1_zh",
sidebarPath: "./versions_sidebars/version-3.5.1_zh.ts",
path: "./versions/version-3.5.1/zh-CN/source",
routeBasePath: "zh/3.5.1",
editCurrentVersion: false,
} satisfies DocsOptions,
],
],

themeConfig: {
// Replace with your project's social card‘
image: "img/docusaurus-social-card.jpg",
tableOfContents: {
maxHeadingLevel: 5,
},
algolia: {
apiKey: "829a7e48ddbd6916e159c003391543a0",
indexName: "zhongyunwanio",
appId: "DGYVABHR0M",
},
navbar: {
logo: {
alt: "Tugraph Site Logo",
src: "https://mdn.alipayobjects.com/huamei_qcdryc/afts/img/A*AbamQ5lxv0IAAAAAAAAAAAAADgOBAQ/original",
},
items: [
{
href: "https://github.com/TuGraph-family/tugraph-db",
label: "GitHub",
position: "right",
},
],
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
} satisfies Preset.ThemeConfig,

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

export default config;
Loading

0 comments on commit b33365b

Please sign in to comment.