├── static ├── .nojekyll └── img │ ├── logo.jpeg │ ├── favicon.ico │ ├── docusaurus.png │ ├── docusaurus-social-card.jpg │ ├── tutorial │ ├── localeDropdown.png │ └── docsVersionDropdown.png │ ├── views_article.svg │ ├── views_user.svg │ ├── views_site.svg │ ├── logo.svg │ ├── undraw_docusaurus_tree.svg │ ├── undraw_docusaurus_mountain.svg │ └── undraw_docusaurus_react.svg ├── .eslintignore ├── docs ├── note │ ├── command │ │ ├── readme.md │ │ ├── git-command.md │ │ └── npm-command.md │ ├── other │ │ ├── readme.md │ │ ├── 2403.03920.pdf │ │ └── markdown-guide.md │ ├── zaindoc │ │ ├── readme.md │ │ └── developer-guide.md │ └── github-multiple-connection.md └── doc │ ├── tutorial-basics │ ├── _category_.json │ ├── deploy-your-site.md │ ├── congratulations.md │ ├── create-a-blog-post.md │ ├── create-a-page.md │ ├── create-a-document.md │ └── markdown-features.mdx │ ├── tutorial-extras │ ├── _category_.json │ ├── manage-docs-versions.md │ └── translate-your-site.md │ └── intro.md ├── i18n └── zh-CN │ ├── docusaurus-plugin-content-docs │ ├── current │ │ ├── note │ │ │ ├── command │ │ │ │ ├── readme.md │ │ │ │ ├── git-command.md │ │ │ │ └── npm-command.md │ │ │ ├── other │ │ │ │ ├── readme.md │ │ │ │ └── markdown-guide.md │ │ │ ├── zaindoc │ │ │ │ ├── readme.md │ │ │ │ └── developer-guide.md │ │ │ └── github-multiple-connection.md │ │ └── doc │ │ │ ├── tutorial-basics │ │ │ ├── _category_.json │ │ │ ├── deploy-your-site.md │ │ │ ├── congratulations.md │ │ │ ├── create-a-blog-post.md │ │ │ ├── create-a-page.md │ │ │ ├── create-a-document.md │ │ │ └── markdown-features.mdx │ │ │ ├── tutorial-extras │ │ │ ├── _category_.json │ │ │ ├── manage-docs-versions.md │ │ │ └── translate-your-site.md │ │ │ └── intro.md │ └── current.json │ ├── docusaurus-plugin-content-pages │ └── markdown-page.md │ ├── docusaurus-plugin-content-blog │ ├── 2021-08-26-welcome │ │ ├── docusaurus-plushie-banner.jpeg │ │ └── index.md │ ├── options.json │ ├── 2019-05-28-first-blog-post.md │ ├── authors.yml │ ├── 2021-08-01-mdx-blog-post.mdx │ └── 2019-05-29-long-blog-post.md │ ├── docusaurus-theme-classic │ ├── navbar.json │ └── footer.json │ └── code.json ├── src ├── theme │ └── DocBreadcrumbs │ │ ├── styles.module.css │ │ └── index.tsx ├── components │ ├── index.ts │ ├── HomepageFeatures │ │ ├── styles.module.css │ │ └── index.tsx │ └── WebsiteCount │ │ ├── styles.module.css │ │ └── index.tsx ├── pages │ ├── markdown-page.md │ ├── index.module.css │ ├── zain │ │ └── index.tsx │ └── index.tsx ├── css │ └── custom.css └── utils │ └── jsonp.ts ├── babel.config.js ├── blog ├── 2021-08-26-welcome │ ├── docusaurus-plushie-banner.jpeg │ └── index.md ├── 2019-05-28-first-blog-post.md ├── authors.yml ├── 2021-08-01-mdx-blog-post.mdx └── 2019-05-29-long-blog-post.md ├── .vscode └── settings.json ├── .gitignore ├── config └── nginx-zaindoc.conf ├── plugin └── alias.js ├── tsconfig.json ├── .eslintrc.js ├── .github └── workflows │ ├── test-deploy.yml │ └── deploy.yml ├── sidebars.js ├── LICENSE.txt ├── package.json ├── README.md └── docusaurus.config.js /static/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | .docusaurus/ 2 | build/ 3 | -------------------------------------------------------------------------------- /docs/note/command/readme.md: -------------------------------------------------------------------------------- 1 | # Command 2 | 3 | Various commands 4 | -------------------------------------------------------------------------------- /docs/note/other/readme.md: -------------------------------------------------------------------------------- 1 | # Other 2 | 3 | Uncategorized notes 4 | -------------------------------------------------------------------------------- /docs/note/zaindoc/readme.md: -------------------------------------------------------------------------------- 1 | # Zaindoc 2 | 3 | Zaindoc development documentation 4 | -------------------------------------------------------------------------------- /static/img/logo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/zaindoc/main/static/img/logo.jpeg -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/note/command/readme.md: -------------------------------------------------------------------------------- 1 | # 命令 2 | 3 | 各种命令 4 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/note/other/readme.md: -------------------------------------------------------------------------------- 1 | # 其它 2 | 3 | 未分类笔记 4 | -------------------------------------------------------------------------------- /src/theme/DocBreadcrumbs/styles.module.css: -------------------------------------------------------------------------------- 1 | .zaindocBreadcrumbs { 2 | display: flex; 3 | } 4 | -------------------------------------------------------------------------------- /static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/zaindoc/main/static/img/favicon.ico -------------------------------------------------------------------------------- /static/img/docusaurus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/zaindoc/main/static/img/docusaurus.png -------------------------------------------------------------------------------- /docs/doc/tutorial-basics/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Tutorial - Basics", 3 | "position": 2 4 | } 5 | -------------------------------------------------------------------------------- /docs/doc/tutorial-extras/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Tutorial - Extras", 3 | "position": 3 4 | } 5 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/note/zaindoc/readme.md: -------------------------------------------------------------------------------- 1 | # Zaindoc 2 | 3 | Zaindoc 开发文档 4 | -------------------------------------------------------------------------------- /docs/note/other/2403.03920.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/zaindoc/main/docs/note/other/2403.03920.pdf -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | } 4 | -------------------------------------------------------------------------------- /static/img/docusaurus-social-card.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/zaindoc/main/static/img/docusaurus-social-card.jpg -------------------------------------------------------------------------------- /static/img/tutorial/localeDropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/zaindoc/main/static/img/tutorial/localeDropdown.png -------------------------------------------------------------------------------- /static/img/tutorial/docsVersionDropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/zaindoc/main/static/img/tutorial/docsVersionDropdown.png -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/doc/tutorial-basics/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Tutorial - Basics", 3 | "position": 2 4 | } 5 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/doc/tutorial-extras/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Tutorial - Extras", 3 | "position": 3 4 | } 5 | -------------------------------------------------------------------------------- /src/components/index.ts: -------------------------------------------------------------------------------- 1 | export { default as HomepageFeatures } from './HomepageFeatures' 2 | export { default as WebsiteCount } from './WebsiteCount' 3 | -------------------------------------------------------------------------------- /blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/zaindoc/main/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg -------------------------------------------------------------------------------- /src/pages/markdown-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown page example 3 | --- 4 | 5 | # Markdown page example 6 | 7 | You don't need React to write simple standalone pages. 8 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-pages/markdown-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown page example 3 | --- 4 | 5 | # Markdown page example 6 | 7 | You don't need React to write simple standalone pages. 8 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZainChen/zaindoc/main/i18n/zh-CN/docusaurus-plugin-content-blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg -------------------------------------------------------------------------------- /src/components/HomepageFeatures/styles.module.css: -------------------------------------------------------------------------------- 1 | .features { 2 | display: flex; 3 | align-items: center; 4 | padding: 2rem 0; 5 | width: 100%; 6 | } 7 | 8 | .featureSvg { 9 | height: 200px; 10 | width: 200px; 11 | } 12 | -------------------------------------------------------------------------------- /static/img/views_article.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "busuanzi", 4 | "clsx", 5 | "easyops", 6 | "gitee", 7 | "hideable", 8 | "ibruce", 9 | "mkdir", 10 | "typecheck", 11 | "Uncategorized", 12 | "Zaindoc", 13 | "zainjane" 14 | ] 15 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /static/img/views_user.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /config/nginx-zaindoc.conf: -------------------------------------------------------------------------------- 1 | upstream zaindoc_server { 2 | server 127.0.0.1:9999; 3 | } 4 | 5 | server { 6 | listen 80; 7 | server_name local.zaindoc.com; 8 | 9 | location / { 10 | proxy_pass http://zaindoc_server; 11 | proxy_set_header Host $host; 12 | proxy_set_header X-Real-IP $remote_addr; 13 | proxy_set_header X-Forwarded-For $remote_addr; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-blog/options.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "Blog", 4 | "description": "The title for the blog used in SEO" 5 | }, 6 | "description": { 7 | "message": "Blog", 8 | "description": "The description for the blog used in SEO" 9 | }, 10 | "sidebar.title": { 11 | "message": "Recent posts", 12 | "description": "The label for the left sidebar" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /static/img/views_site.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/theme/DocBreadcrumbs/index.tsx: -------------------------------------------------------------------------------- 1 | import DocBreadcrumbs from '@theme-original/DocBreadcrumbs' 2 | import React from 'react' 3 | import { WebsiteCount } from 'src/components' 4 | 5 | import styles from './styles.module.css' 6 | 7 | export default function DocBreadcrumbsWrapper() { 8 | return ( 9 |
10 | 11 | 12 |
13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /blog/2019-05-28-first-blog-post.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: first-blog-post 3 | title: First Blog Post 4 | authors: 5 | name: Gao Wei 6 | title: Docusaurus Core Team 7 | url: https://github.com/wgao19 8 | image_url: https://github.com/wgao19.png 9 | tags: [hola, docusaurus] 10 | --- 11 | 12 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 13 | -------------------------------------------------------------------------------- /src/pages/index.module.css: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS files with the .module.css suffix will be treated as CSS modules 3 | * and scoped locally. 4 | */ 5 | 6 | .heroBanner { 7 | padding: 4rem 0; 8 | text-align: center; 9 | position: relative; 10 | overflow: hidden; 11 | } 12 | 13 | @media screen and (max-width: 996px) { 14 | .heroBanner { 15 | padding: 2rem; 16 | } 17 | } 18 | 19 | .buttons { 20 | display: flex; 21 | align-items: center; 22 | justify-content: center; 23 | } 24 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-blog/2019-05-28-first-blog-post.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: first-blog-post 3 | title: First Blog Post 4 | authors: 5 | name: Gao Wei 6 | title: Docusaurus Core Team 7 | url: https://github.com/wgao19 8 | image_url: https://github.com/wgao19.png 9 | tags: [hola, docusaurus] 10 | --- 11 | 12 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 13 | -------------------------------------------------------------------------------- /plugin/alias.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | 3 | module.exports = async function pluginAlias() { 4 | return { 5 | name: 'zain-alias-plugin', 6 | configureWebpack() { 7 | return { 8 | resolve: { 9 | alias: { 10 | // 模块导入别名,指定后可以在文件之直接 import * from 'src/*'; 11 | // 在 tsconfig.json 中添加 "paths": {"src/*": ["./src/*"]} 12 | src: path.resolve(__dirname, '../src/'), 13 | }, 14 | }, 15 | } 16 | }, 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /blog/authors.yml: -------------------------------------------------------------------------------- 1 | endi: 2 | name: Endilie Yacop Sucipto 3 | title: Maintainer of Docusaurus 4 | url: https://github.com/endiliey 5 | image_url: https://github.com/endiliey.png 6 | 7 | yangshun: 8 | name: Yangshun Tay 9 | title: Front End Engineer @ Facebook 10 | url: https://github.com/yangshun 11 | image_url: https://github.com/yangshun.png 12 | 13 | slorber: 14 | name: Sébastien Lorber 15 | title: Docusaurus maintainer 16 | url: https://sebastienlorber.com 17 | image_url: https://github.com/slorber.png 18 | -------------------------------------------------------------------------------- /blog/2021-08-01-mdx-blog-post.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | slug: mdx-blog-post 3 | title: MDX Blog Post 4 | authors: [slorber] 5 | tags: [docusaurus] 6 | --- 7 | 8 | Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/markdown-features), such as [MDX](https://mdxjs.com/). 9 | 10 | :::tip 11 | 12 | Use the power of React to create interactive blog posts. 13 | 14 | ```js 15 | 16 | ``` 17 | 18 | 19 | 20 | ::: 21 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // This file is not used in compilation. It is here just for a nice editor experience. 3 | "extends": "@tsconfig/docusaurus/tsconfig.json", 4 | "compilerOptions": { 5 | "baseUrl": ".", 6 | // 启用所有严格类型检查选项 7 | "strict": true, 8 | }, 9 | // 指定模块的路径,和 baseUrl 有关联,和 webpack 中 resolve.alias 配置一样(webpack 中已配置) 10 | "paths": { 11 | // 模块导入别名,指定后 vscode 可在文件中识别 import * from 'src/*'; 12 | // 需要在 docusaurus.config.js 中添加 Webpack 别名配置 resolve.alias 13 | "src/*": [ 14 | "./src/*" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-blog/authors.yml: -------------------------------------------------------------------------------- 1 | endi: 2 | name: Endilie Yacop Sucipto 3 | title: Maintainer of Docusaurus 4 | url: https://github.com/endiliey 5 | image_url: https://github.com/endiliey.png 6 | 7 | yangshun: 8 | name: Yangshun Tay 9 | title: Front End Engineer @ Facebook 10 | url: https://github.com/yangshun 11 | image_url: https://github.com/yangshun.png 12 | 13 | slorber: 14 | name: Sébastien Lorber 15 | title: Docusaurus maintainer 16 | url: https://sebastienlorber.com 17 | image_url: https://github.com/slorber.png 18 | -------------------------------------------------------------------------------- /src/components/WebsiteCount/styles.module.css: -------------------------------------------------------------------------------- 1 | .websiteCount { 2 | flex: 1; 3 | display: inline-block; 4 | margin-bottom: 0.8rem; 5 | margin-left: 0.4rem; 6 | } 7 | 8 | .websiteCount > div { 9 | display: inline-flex; 10 | align-items: center; 11 | } 12 | 13 | .svgSiteCount { 14 | padding-top: 0.2rem; 15 | } 16 | 17 | .svgSiteCount > svg { 18 | height: 24px; 19 | width: 24px; 20 | color: var(--ifm-font-color-base); 21 | margin-left: 0.8rem; 22 | margin-right: 0.2rem; 23 | } 24 | 25 | .svgSiteCount > span { 26 | font-size: 0.8rem; 27 | } 28 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-blog/2021-08-01-mdx-blog-post.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | slug: mdx-blog-post 3 | title: MDX Blog Post 4 | authors: [slorber] 5 | tags: [docusaurus] 6 | --- 7 | 8 | Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/markdown-features), such as [MDX](https://mdxjs.com/). 9 | 10 | :::tip 11 | 12 | Use the power of React to create interactive blog posts. 13 | 14 | ```js 15 | 16 | ``` 17 | 18 | 19 | 20 | ::: 21 | -------------------------------------------------------------------------------- /src/pages/zain/index.tsx: -------------------------------------------------------------------------------- 1 | import useDocusaurusContext from '@docusaurus/useDocusaurusContext' 2 | import Layout from '@theme/Layout' 3 | import React from 'react' 4 | import { WebsiteCount } from 'src/components' 5 | 6 | export default function Zain(): JSX.Element { 7 | const { siteConfig } = useDocusaurusContext() 8 | 9 | return ( 10 | 11 | jane 12 |
13 | zain 14 |
15 | 16 |
17 |
18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: 'eslint-config-zain', 3 | parserOptions: { 4 | ecmaVersion: 2020, 5 | sourceType: 'module', 6 | project: './tsconfig.json', 7 | tsconfigRootDir: __dirname, 8 | createDefaultProgram: true, 9 | }, 10 | settings: { 11 | 'import/resolver': { 12 | node: {}, 13 | webpack: { 14 | // This line can be added or not according to your own configuration 15 | // config: require.resolve('./configs/webpack.config.eslint.ts'), 16 | }, 17 | typescript: {}, 18 | }, 19 | }, 20 | rules: { 21 | 'import/no-unresolved': 'off', 22 | 'global-require': 'off', 23 | }, 24 | } 25 | -------------------------------------------------------------------------------- /.github/workflows/test-deploy.yml: -------------------------------------------------------------------------------- 1 | name: Test deployment 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - main 7 | # Review gh actions docs if you want to further define triggers, paths, etc 8 | # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on 9 | 10 | jobs: 11 | test-deploy: 12 | name: Test deployment 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v2 16 | - uses: actions/setup-node@v3 17 | with: 18 | node-version: 16.x 19 | cache: npm 20 | 21 | - name: Install dependencies 22 | run: npm ci 23 | - name: Test build website 24 | run: npm run build -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-theme-classic/navbar.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "Zaindoc", 4 | "description": "The title in the navbar" 5 | }, 6 | "item.label.Note": { 7 | "message": "笔记", 8 | "description": "Navbar item with label Note" 9 | }, 10 | "item.label.Doc": { 11 | "message": "文档", 12 | "description": "Navbar item with label Doc" 13 | }, 14 | "item.label.Blog": { 15 | "message": "博客", 16 | "description": "Navbar item with label Blog" 17 | }, 18 | "item.label.Zain": { 19 | "message": "Zain", 20 | "description": "Navbar item with label Zain" 21 | }, 22 | "item.label.GitHub": { 23 | "message": "GitHub", 24 | "description": "Navbar item with label GitHub" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/note/command/git-command.md: -------------------------------------------------------------------------------- 1 | # Git 命令 2 | 3 | --- 4 | 5 | ### 删除 Git 过滤的文件和文件夹 6 | 7 | ```bash 8 | # 使用 Git 清除所有未被跟踪的文件和目录 9 | # -f:强制删除(无需确认) 10 | # -x:包括忽略清单中列出的文件和目录 11 | # -d: 包含未被版本控制系统跟踪的目录(注意:此选项会删除包括空目录) 12 | git clean -fxd 13 | ``` 14 | 15 | ### 重置分支 16 | 17 | ```bash 18 | # 切换到旧的分支 dev 19 | git checkout dev 20 | 21 | # 将旧的分支 dev 重置成 master 22 | git reset --hard master 23 | 24 | # 再推强制送到远程仓库(需要远程仓库开启强制推送权限) 25 | git push origin dev --force 26 | ``` 27 | 28 | ### 删除 tag 29 | 30 | ```bash 31 | # 删除本地 tag 32 | git tag --delete TagName 33 | 34 | # 同步到远程仓库 35 | git push origin :TagName 36 | ``` 37 | 38 | ### 同步本地的远程分支 39 | 40 | ```bash 41 | # 查看本地分支和追踪情况 42 | git remote show origin 43 | 44 | # 删本地多余的远程分支 45 | git remote prune origin 46 | ``` 47 | -------------------------------------------------------------------------------- /docs/doc/tutorial-basics/deploy-your-site.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 5 3 | --- 4 | 5 | # Deploy your site 6 | 7 | Docusaurus is a **static-site-generator** (also called **[Jamstack](https://jamstack.org/)**). 8 | 9 | It builds your site as simple **static HTML, JavaScript and CSS files**. 10 | 11 | ## Build your site 12 | 13 | Build your site **for production**: 14 | 15 | ```bash 16 | npm run build 17 | ``` 18 | 19 | The static files are generated in the `build` folder. 20 | 21 | ## Deploy your site 22 | 23 | Test your production build locally: 24 | 25 | ```bash 26 | npm run serve 27 | ``` 28 | 29 | The `build` folder is now served at `http://localhost:3000/`. 30 | 31 | You can now deploy the `build` folder **almost anywhere** easily, **for free** or very small cost (read the **[Deployment Guide](https://docusaurus.io/docs/deployment)**). 32 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/doc/tutorial-basics/deploy-your-site.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 5 3 | --- 4 | 5 | # Deploy your site 6 | 7 | Docusaurus is a **static-site-generator** (also called **[Jamstack](https://jamstack.org/)**). 8 | 9 | It builds your site as simple **static HTML, JavaScript and CSS files**. 10 | 11 | ## Build your site 12 | 13 | Build your site **for production**: 14 | 15 | ```bash 16 | npm run build 17 | ``` 18 | 19 | The static files are generated in the `build` folder. 20 | 21 | ## Deploy your site 22 | 23 | Test your production build locally: 24 | 25 | ```bash 26 | npm run serve 27 | ``` 28 | 29 | The `build` folder is now served at `http://localhost:3000/`. 30 | 31 | You can now deploy the `build` folder **almost anywhere** easily, **for free** or very small cost (read the **[Deployment Guide](https://docusaurus.io/docs/deployment)**). 32 | -------------------------------------------------------------------------------- /blog/2021-08-26-welcome/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: welcome 3 | title: Welcome 4 | authors: [slorber, yangshun] 5 | tags: [facebook, hello, docusaurus] 6 | --- 7 | 8 | [Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog). 9 | 10 | Simply add Markdown files (or folders) to the `blog` directory. 11 | 12 | Regular blog authors can be added to `authors.yml`. 13 | 14 | The blog post date can be extracted from filenames, such as: 15 | 16 | - `2019-05-30-welcome.md` 17 | - `2019-05-30-welcome/index.md` 18 | 19 | A blog post folder can be convenient to co-locate blog post images: 20 | 21 | ![Docusaurus Plushie](./docusaurus-plushie-banner.jpeg) 22 | 23 | The blog supports tags as well! 24 | 25 | **And if you don't want a blog**: just delete this directory, and use `blog: false` in your Docusaurus config. 26 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-blog/2021-08-26-welcome/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: welcome 3 | title: Welcome 4 | authors: [slorber, yangshun] 5 | tags: [facebook, hello, docusaurus] 6 | --- 7 | 8 | [Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog). 9 | 10 | Simply add Markdown files (or folders) to the `blog` directory. 11 | 12 | Regular blog authors can be added to `authors.yml`. 13 | 14 | 博客文章的日期可以从文件名中提取出来,比如说: 15 | 16 | - `2019-05-30-welcome.md` 17 | - `2019-05-30-welcome/index.md` 18 | 19 | A blog post folder can be convenient to co-locate blog post images: 20 | 21 | ![Docusaurus Plushie](./docusaurus-plushie-banner.jpeg) 22 | 23 | The blog supports tags as well! 24 | 25 | **And if you don't want a blog**: just delete this directory, and use `blog: false` in your Docusaurus config. 26 | -------------------------------------------------------------------------------- /docs/doc/tutorial-basics/congratulations.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 6 3 | --- 4 | 5 | # Congratulations! 6 | 7 | You have just learned the **basics of Docusaurus** and made some changes to the **initial template**. 8 | 9 | Docusaurus has **much more to offer**! 10 | 11 | Have **5 more minutes**? Take a look at **[versioning](../tutorial-extras/manage-docs-versions.md)** and **[i18n](../tutorial-extras/translate-your-site.md)**. 12 | 13 | Anything **unclear** or **buggy** in this tutorial? [Please report it!](https://github.com/facebook/docusaurus/discussions/4610) 14 | 15 | ## What's next? 16 | 17 | - Read the [official documentation](https://docusaurus.io/). 18 | - Add a custom [Design and Layout](https://docusaurus.io/docs/styling-layout) 19 | - Add a [search bar](https://docusaurus.io/docs/search) 20 | - Find inspirations in the [Docusaurus showcase](https://docusaurus.io/showcase) 21 | - Get involved in the [Docusaurus Community](https://docusaurus.io/community/support) 22 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/note/command/npm-command.md: -------------------------------------------------------------------------------- 1 | # Npm 命令 2 | 3 | --- 4 | 5 | ### 排序 dependencies 和 devDependencies 中的依赖包 6 | 7 | 在不安装依赖包的情况下,对 `dependencies` 和 `devDependencies` 中的依赖包进行排序 8 | 9 | 从依赖项中删除或卸载不存在的包即可 10 | 11 | ```bash 12 | # npm: 这是 Node.js 包管理器(Node Package Manager)的命令 13 | # r: 缩写 remove,表示要移除某个包 14 | # -S: 缩写 --save,表示要将依赖项写入项目的 package.json 文件 15 | # example-package: 要移除的包的名称(随便取一个不存在的包) 16 | npm r -S example-package 17 | ``` 18 | 19 | ### nvm 安装新版本 node,并将指定版本 node 的全局依赖包全部迁移 20 | 21 | ```bash 22 | # 使用 nvm 安装 Node.js 版本 v18.15.0 23 | # 重新安装所有包,并使用之前已经安装的版本 v18.14.2 的依赖关系 24 | nvm install v18.15.0 --reinstall-packages-from=v18.14.2 25 | ``` 26 | 27 | ### 查看所有全局依赖包 28 | 29 | ```bash 30 | # npm ls: 列出当前安装的包及其依赖。 31 | # --global: 查看全局安装的包。 32 | # --depth 0: 只显示第一层级别的包,因为传递给此命令的深度参数为0 33 | npm ls --global --depth 0 34 | ``` 35 | 36 | ### 从源码安装 nrm 37 | 38 | 如果直接用 `npm i nrm -g` 安装,会识别不了当前正在使用的源 39 | 40 | ```bash 41 | npm i Pana/nrm -g 42 | ``` 43 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current.json: -------------------------------------------------------------------------------- 1 | { 2 | "version.label": { 3 | "message": "Next", 4 | "description": "The label for version current" 5 | }, 6 | "sidebar.tutorialSidebar.category.Tutorial - Basics": { 7 | "message": "Tutorial - Basics", 8 | "description": "The label for category Tutorial - Basics in sidebar tutorialSidebar" 9 | }, 10 | "sidebar.tutorialSidebar.category.Tutorial - Extras": { 11 | "message": "Tutorial - Extras", 12 | "description": "The label for category Tutorial - Extras in sidebar tutorialSidebar" 13 | }, 14 | "sidebar.note.category.命令": { 15 | "message": "命令", 16 | "description": "The label for category Command in sidebar note" 17 | }, 18 | "sidebar.note.category.其它": { 19 | "message": "其它", 20 | "description": "The label for category Other in sidebar note" 21 | }, 22 | "sidebar.note.category.Zaindoc": { 23 | "message": "Zaindoc", 24 | "description": "The label for category Zaindoc in sidebar note" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/doc/tutorial-basics/congratulations.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 6 3 | --- 4 | 5 | # Congratulations! 6 | 7 | You have just learned the **basics of Docusaurus** and made some changes to the **initial template**. 8 | 9 | Docusaurus has **much more to offer**! 10 | 11 | Have **5 more minutes**? Take a look at **[versioning](../tutorial-extras/manage-docs-versions.md)** and **[i18n](../tutorial-extras/translate-your-site.md)**. 12 | 13 | Anything **unclear** or **buggy** in this tutorial? [Please report it!](https://github.com/facebook/docusaurus/discussions/4610) 14 | 15 | ## What's next? 16 | 17 | - Read the [official documentation](https://docusaurus.io/). 18 | - Add a custom [Design and Layout](https://docusaurus.io/docs/styling-layout) 19 | - Add a [search bar](https://docusaurus.io/docs/search) 20 | - Find inspirations in the [Docusaurus showcase](https://docusaurus.io/showcase) 21 | - Get involved in the [Docusaurus Community](https://docusaurus.io/community/support) 22 | -------------------------------------------------------------------------------- /docs/doc/tutorial-basics/create-a-blog-post.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 3 3 | --- 4 | 5 | # Create a Blog Post 6 | 7 | Docusaurus creates a **page for each blog post**, but also a **blog index page**, a **tag system**, an **RSS** feed... 8 | 9 | ## Create your first Post 10 | 11 | Create a file at `blog/2021-02-28-greetings.md`: 12 | 13 | ```md title="blog/2021-02-28-greetings.md" 14 | --- 15 | slug: greetings 16 | title: Greetings! 17 | authors: 18 | - name: Joel Marcey 19 | title: Co-creator of Docusaurus 1 20 | url: https://github.com/JoelMarcey 21 | image_url: https://github.com/JoelMarcey.png 22 | - name: Sébastien Lorber 23 | title: Docusaurus maintainer 24 | url: https://sebastienlorber.com 25 | image_url: https://github.com/slorber.png 26 | tags: [greetings] 27 | --- 28 | 29 | Congratulations, you have made your first post! 30 | 31 | Feel free to play around and edit this post as much you like. 32 | ``` 33 | 34 | A new blog post is now available at `http://localhost:3000/blog/greetings`. 35 | -------------------------------------------------------------------------------- /sidebars.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creating a sidebar enables you to: 3 | - create an ordered group of docs 4 | - render a sidebar for each doc of that group 5 | - provide next/previous navigation 6 | 7 | The sidebars can be generated from the filesystem, or explicitly defined here. 8 | 9 | Create as many sidebars as you want. 10 | */ 11 | 12 | // @ts-check 13 | 14 | /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ 15 | const sidebars = { 16 | // By default, Docusaurus generates a sidebar from the docs folder structure 17 | doc: [{ type: 'autogenerated', dirName: 'doc' }], 18 | 19 | // But you can create a sidebar manually 20 | /* 21 | tutorialSidebar: [ 22 | 'intro', 23 | 'hello', 24 | { 25 | type: 'category', 26 | label: 'Tutorial', 27 | items: ['tutorial-basics/create-a-document'], 28 | }, 29 | ], 30 | */ 31 | 32 | sidebarIdNote: [ 33 | { 34 | type: 'autogenerated', 35 | dirName: 'note', 36 | }, 37 | ], 38 | } 39 | 40 | module.exports = sidebars 41 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/doc/tutorial-basics/create-a-blog-post.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 3 3 | --- 4 | 5 | # Create a Blog Post 6 | 7 | Docusaurus creates a **page for each blog post**, but also a **blog index page**, a **tag system**, an **RSS** feed... 8 | 9 | ## Create your first Post 10 | 11 | Create a file at `blog/2021-02-28-greetings.md`: 12 | 13 | ```md title="blog/2021-02-28-greetings.md" 14 | --- 15 | slug: greetings 16 | title: Greetings! 17 | authors: 18 | - name: Joel Marcey 19 | title: Co-creator of Docusaurus 1 20 | url: https://github.com/JoelMarcey 21 | image_url: https://github.com/JoelMarcey.png 22 | - name: Sébastien Lorber 23 | title: Docusaurus maintainer 24 | url: https://sebastienlorber.com 25 | image_url: https://github.com/slorber.png 26 | tags: [greetings] 27 | --- 28 | 29 | Congratulations, you have made your first post! 30 | 31 | Feel free to play around and edit this post as much you like. 32 | ``` 33 | 34 | A new blog post is now available at `http://localhost:3000/blog/greetings`. 35 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 - present ZainChen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/doc/tutorial-basics/create-a-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # Create a Page 6 | 7 | Add **Markdown or React** files to `src/pages` to create a **standalone page**: 8 | 9 | - `src/pages/index.js` -> `localhost:3000/` 10 | - `src/pages/foo.md` -> `localhost:3000/foo` 11 | - `src/pages/foo/bar.js` -> `localhost:3000/foo/bar` 12 | 13 | ## Create your first React Page 14 | 15 | Create a file at `src/pages/my-react-page.js`: 16 | 17 | ```jsx title="src/pages/my-react-page.js" 18 | import React from 'react'; 19 | import Layout from '@theme/Layout'; 20 | 21 | export default function MyReactPage() { 22 | return ( 23 | 24 |

My React page

25 |

This is a React page

26 |
27 | ); 28 | } 29 | ``` 30 | 31 | A new page is now available at `http://localhost:3000/my-react-page`. 32 | 33 | ## Create your first Markdown Page 34 | 35 | Create a file at `src/pages/my-markdown-page.md`: 36 | 37 | ```mdx title="src/pages/my-markdown-page.md" 38 | # My Markdown page 39 | 40 | This is a Markdown page 41 | ``` 42 | 43 | A new page is now available at `http://localhost:3000/my-markdown-page`. 44 | -------------------------------------------------------------------------------- /docs/note/command/git-command.md: -------------------------------------------------------------------------------- 1 | # Git commands 2 | 3 | --- 4 | 5 | ### Delete Files and Directories Filtered by Git 6 | 7 | ```bash 8 | # Use Git to clear all untracked files and directories 9 | # -f: Force deletion (no confirmation required) 10 | # -x: Includes files and directories listed in the ignore checklist 11 | # -d: Includes directories not tracked by the version control system (note: this option will delete even empty directories) 12 | git clean -fxd 13 | ``` 14 | 15 | ### Reset Branch 16 | 17 | ```bash 18 | # Switch to the old branch "dev" 19 | git checkout dev 20 | 21 | # Reset the old branch "dev" to "master" 22 | git reset --hard master 23 | 24 | # Then, push the force to the remote repository (requires force push permission) 25 | git push origin dev --force 26 | ``` 27 | 28 | ### Delete Tag 29 | 30 | ```bash 31 | # Delete local tag 32 | git tag --delete TagName 33 | 34 | # Synchronize to the remote repository 35 | git push origin :TagName 36 | ``` 37 | 38 | ### Synchronize local remote branches 39 | 40 | ```bash 41 | # View local branches and tracking 42 | git remote show origin 43 | 44 | # Delete local redundant remote branches 45 | git remote prune origin 46 | ``` 47 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/doc/tutorial-basics/create-a-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # Create a Page 6 | 7 | Add **Markdown or React** files to `src/pages` to create a **standalone page**: 8 | 9 | - `src/pages/index.js` -> `localhost:3000/` 10 | - `src/pages/foo.md` -> `localhost:3000/foo` 11 | - `src/pages/foo/bar.js` -> `localhost:3000/foo/bar` 12 | 13 | ## Create your first React Page 14 | 15 | Create a file at `src/pages/my-react-page.js`: 16 | 17 | ```jsx title="src/pages/my-react-page.js" 18 | import React from 'react'; 19 | import Layout from '@theme/Layout'; 20 | 21 | export default function MyReactPage() { 22 | return ( 23 | 24 |

My React page

25 |

This is a React page

26 |
27 | ); 28 | } 29 | ``` 30 | 31 | A new page is now available at `http://localhost:3000/my-react-page`. 32 | 33 | ## Create your first Markdown Page 34 | 35 | Create a file at `src/pages/my-markdown-page.md`: 36 | 37 | ```mdx title="src/pages/my-markdown-page.md" 38 | # My Markdown page 39 | 40 | This is a Markdown page 41 | ``` 42 | 43 | A new page is now available at `http://localhost:3000/my-markdown-page`. 44 | -------------------------------------------------------------------------------- /docs/doc/tutorial-basics/create-a-document.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Create a Document 6 | 7 | Documents are **groups of pages** connected through: 8 | 9 | - a **sidebar** 10 | - **previous/next navigation** 11 | - **versioning** 12 | 13 | ## Create your first Doc 14 | 15 | Create a markdown file at `docs/hello.md`: 16 | 17 | ```md title="docs/hello.md" 18 | # Hello 19 | 20 | This is my **first Docusaurus document**! 21 | ``` 22 | 23 | A new document is now available at `http://localhost:3000/docs/hello`. 24 | 25 | ## Configure the Sidebar 26 | 27 | Docusaurus automatically **creates a sidebar** from the `docs` folder. 28 | 29 | Add metadata to customize the sidebar label and position: 30 | 31 | ```md title="docs/hello.md" {1-4} 32 | --- 33 | sidebar_label: 'Hi!' 34 | sidebar_position: 3 35 | --- 36 | 37 | # Hello 38 | 39 | This is my **first Docusaurus document**! 40 | ``` 41 | 42 | It is also possible to create your sidebar explicitly in `sidebars.js`: 43 | 44 | ```js title="sidebars.js" 45 | module.exports = { 46 | tutorialSidebar: [ 47 | { 48 | type: 'category', 49 | label: 'Tutorial', 50 | // highlight-next-line 51 | items: ['hello'], 52 | }, 53 | ], 54 | }; 55 | ``` 56 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/doc/tutorial-basics/create-a-document.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Create a Document 6 | 7 | Documents are **groups of pages** connected through: 8 | 9 | - a **sidebar** 10 | - **previous/next navigation** 11 | - **versioning** 12 | 13 | ## Create your first Doc 14 | 15 | Create a markdown file at `docs/hello.md`: 16 | 17 | ```md title="docs/hello.md" 18 | # Hello 19 | 20 | This is my **first Docusaurus document**! 21 | ``` 22 | 23 | A new document is now available at `http://localhost:3000/docs/hello`. 24 | 25 | ## Configure the Sidebar 26 | 27 | Docusaurus automatically **creates a sidebar** from the `docs` folder. 28 | 29 | Add metadata to customize the sidebar label and position: 30 | 31 | ```md title="docs/hello.md" {1-4} 32 | --- 33 | sidebar_label: 'Hi!' 34 | sidebar_position: 3 35 | --- 36 | 37 | # Hello 38 | 39 | This is my **first Docusaurus document**! 40 | ``` 41 | 42 | It is also possible to create your sidebar explicitly in `sidebars.js`: 43 | 44 | ```js title="sidebars.js" 45 | module.exports = { 46 | tutorialSidebar: [ 47 | { 48 | type: 'category', 49 | label: 'Tutorial', 50 | // highlight-next-line 51 | items: ['hello'], 52 | }, 53 | ], 54 | }; 55 | ``` 56 | -------------------------------------------------------------------------------- /src/pages/index.tsx: -------------------------------------------------------------------------------- 1 | import Link from '@docusaurus/Link' 2 | import useDocusaurusContext from '@docusaurus/useDocusaurusContext' 3 | import Layout from '@theme/Layout' 4 | import clsx from 'clsx' 5 | import React from 'react' 6 | import HomepageFeatures from 'src/components/HomepageFeatures' 7 | 8 | import styles from './index.module.css' 9 | 10 | function HomepageHeader() { 11 | const { siteConfig } = useDocusaurusContext() 12 | return ( 13 |
14 |
15 |

{siteConfig.title}

16 |

{siteConfig.tagline}

17 |
18 | 19 | Docusaurus Tutorial - 5min ⏱️ 20 | 21 |
22 |
23 |
24 | ) 25 | } 26 | 27 | export default function Home(): JSX.Element { 28 | const { siteConfig } = useDocusaurusContext() 29 | return ( 30 | 31 | 32 |
33 | 34 |
35 |
36 | ) 37 | } 38 | -------------------------------------------------------------------------------- /docs/doc/tutorial-extras/manage-docs-versions.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # Manage Docs Versions 6 | 7 | Docusaurus can manage multiple versions of your docs. 8 | 9 | ## Create a docs version 10 | 11 | Release a version 1.0 of your project: 12 | 13 | ```bash 14 | npm run docusaurus docs:version 1.0 15 | ``` 16 | 17 | The `docs` folder is copied into `versioned_docs/version-1.0` and `versions.json` is created. 18 | 19 | Your docs now have 2 versions: 20 | 21 | - `1.0` at `http://localhost:3000/docs/` for the version 1.0 docs 22 | - `current` at `http://localhost:3000/docs/next/` for the **upcoming, unreleased docs** 23 | 24 | ## Add a Version Dropdown 25 | 26 | To navigate seamlessly across versions, add a version dropdown. 27 | 28 | Modify the `docusaurus.config.js` file: 29 | 30 | ```js title="docusaurus.config.js" 31 | module.exports = { 32 | themeConfig: { 33 | navbar: { 34 | items: [ 35 | // highlight-start 36 | { 37 | type: 'docsVersionDropdown', 38 | }, 39 | // highlight-end 40 | ], 41 | }, 42 | }, 43 | }; 44 | ``` 45 | 46 | The docs version dropdown appears in your navbar: 47 | 48 | ![Docs Version Dropdown](/img/tutorial/docsVersionDropdown.png) 49 | 50 | ## Update an existing version 51 | 52 | It is possible to edit versioned docs in their respective folder: 53 | 54 | - `versioned_docs/version-1.0/hello.md` updates `http://localhost:3000/docs/hello` 55 | - `docs/hello.md` updates `http://localhost:3000/docs/next/hello` 56 | -------------------------------------------------------------------------------- /docs/note/command/npm-command.md: -------------------------------------------------------------------------------- 1 | # Npm command 2 | 3 | --- 4 | 5 | ### Sort dependencies and devDependencies in order 6 | 7 | Sort the dependencies in `dependencies` and `devDependencies` without installing packages. 8 | 9 | Simply remove or uninstall the missing packages from the dependency list. 10 | 11 | ```bash 12 | # npm: Node Package Manager 13 | # r: abbreviation for remove, meaning to remove a package 14 | # -S: abbreviation for --save, meaning to save the dependency in the project's package.json file 15 | # example-package: the name of the package to be removed (any non-existent package name can be used) 16 | npm r -S example-package 17 | ``` 18 | 19 | ### nvm install new version of Node and migrate all global dependencies of a specified Node version 20 | 21 | ```bash 22 | # Install Node.js version v18.15.0 using nvm 23 | # Reinstall all packages and use the dependency relationships of previously installed version v18.14.2 24 | nvm install v18.15.0 --reinstall-packages-from=v18.14.2 25 | ``` 26 | 27 | ### Display all global dependencies 28 | 29 | ```bash 30 | # npm ls: list all installed packages and their dependencies 31 | # --global: view globally installed packages 32 | # --depth 0: only display the first level packages as the depth parameter passed to this command is 0 33 | npm ls --global --depth 0 34 | ``` 35 | 36 | #### Install nrm from source code 37 | 38 | When installing `nrm` directly with `npm i nrm -g`, the current source used will not be recognized. 39 | 40 | ```bash 41 | npm i Pana/nrm -g 42 | ``` 43 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/doc/tutorial-extras/manage-docs-versions.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # Manage Docs Versions 6 | 7 | Docusaurus can manage multiple versions of your docs. 8 | 9 | ## Create a docs version 10 | 11 | Release a version 1.0 of your project: 12 | 13 | ```bash 14 | npm run docusaurus docs:version 1.0 15 | ``` 16 | 17 | The `docs` folder is copied into `versioned_docs/version-1.0` and `versions.json` is created. 18 | 19 | Your docs now have 2 versions: 20 | 21 | - `1.0` at `http://localhost:3000/docs/` for the version 1.0 docs 22 | - `current` at `http://localhost:3000/docs/next/` for the **upcoming, unreleased docs** 23 | 24 | ## Add a Version Dropdown 25 | 26 | To navigate seamlessly across versions, add a version dropdown. 27 | 28 | Modify the `docusaurus.config.js` file: 29 | 30 | ```js title="docusaurus.config.js" 31 | module.exports = { 32 | themeConfig: { 33 | navbar: { 34 | items: [ 35 | // highlight-start 36 | { 37 | type: 'docsVersionDropdown', 38 | }, 39 | // highlight-end 40 | ], 41 | }, 42 | }, 43 | }; 44 | ``` 45 | 46 | The docs version dropdown appears in your navbar: 47 | 48 | ![Docs Version Dropdown](/img/tutorial/docsVersionDropdown.png) 49 | 50 | ## Update an existing version 51 | 52 | It is possible to edit versioned docs in their respective folder: 53 | 54 | - `versioned_docs/version-1.0/hello.md` updates `http://localhost:3000/docs/hello` 55 | - `docs/hello.md` updates `http://localhost:3000/docs/next/hello` 56 | -------------------------------------------------------------------------------- /src/css/custom.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Any CSS included here will be global. The classic template 3 | * bundles Infima by default. Infima is a CSS framework designed to 4 | * work well for content-centric websites. 5 | */ 6 | 7 | /* You can override the default Infima variables here. */ 8 | :root { 9 | --ifm-color-primary: #387ca0; 10 | --ifm-color-primary-dark: #327090; 11 | --ifm-color-primary-darker: #306988; 12 | --ifm-color-primary-darkest: #275770; 13 | --ifm-color-primary-light: #3e88b0; 14 | --ifm-color-primary-lighter: #408fb8; 15 | --ifm-color-primary-lightest: #559dc4; 16 | --ifm-menu-color: #414755; 17 | --ifm-code-font-size: 95%; 18 | --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); 19 | } 20 | 21 | /* For readability concerns, you should choose a lighter palette in dark mode. */ 22 | [data-theme='dark'] { 23 | --ifm-color-primary: #499cc6; 24 | --ifm-color-primary-dark: #3a8fba; 25 | --ifm-color-primary-darker: #3787af; 26 | --ifm-color-primary-darkest: #2d6f90; 27 | --ifm-color-primary-light: #5ea7cc; 28 | --ifm-color-primary-lighter: #68add0; 29 | --ifm-color-primary-lightest: #87bed9; 30 | --ifm-menu-color: #ebecf0; 31 | --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); 32 | } 33 | 34 | .docusaurus-highlight-code-line { 35 | background-color: rgba(0, 0, 0, 0.1); 36 | display: block; 37 | margin: 0 calc(-1 * var(--ifm-pre-padding)); 38 | padding: 0 var(--ifm-pre-padding); 39 | } 40 | 41 | [data-theme='dark'] .docusaurus-highlight-code-line { 42 | background-color: rgba(0, 0, 0, 0.3); 43 | } 44 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "zaindoc", 3 | "version": "0.0.1", 4 | "description": "zaindoc", 5 | "private": true, 6 | "scripts": { 7 | "docusaurus": "docusaurus", 8 | "start": "docusaurus start --port 9999", 9 | "build": "docusaurus build", 10 | "swizzle": "docusaurus swizzle", 11 | "deploy": "docusaurus deploy", 12 | "clear": "docusaurus clear", 13 | "serve": "docusaurus serve", 14 | "write-translations": "docusaurus write-translations", 15 | "write-heading-ids": "docusaurus write-heading-ids", 16 | "typecheck": "tsc", 17 | "lint": "eslint . --ext .js,.jsx,.ts,.tsx", 18 | "lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix" 19 | }, 20 | "dependencies": { 21 | "@docusaurus/core": "2.4.0", 22 | "@docusaurus/preset-classic": "2.4.0", 23 | "@easyops-cn/docusaurus-search-local": "^0.30.2", 24 | "@mdx-js/react": "^1.6.22", 25 | "clsx": "^1.2.1", 26 | "prism-react-renderer": "^1.3.5", 27 | "react": "^17.0.2", 28 | "react-dom": "^17.0.2" 29 | }, 30 | "devDependencies": { 31 | "@docusaurus/module-type-aliases": "2.4.0", 32 | "@tsconfig/docusaurus": "^1.0.5", 33 | "eslint-config-zain": "^1.0.8", 34 | "typescript": "^4.7.4" 35 | }, 36 | "browserslist": { 37 | "production": [ 38 | ">0.5%", 39 | "not dead", 40 | "not op_mini all" 41 | ], 42 | "development": [ 43 | "last 1 chrome version", 44 | "last 1 firefox version", 45 | "last 1 safari version" 46 | ] 47 | }, 48 | "engines": { 49 | "node": ">=16.14" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy to GitHub Pages 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | # Review gh actions docs if you want to further define triggers, paths, etc 8 | # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on 9 | 10 | jobs: 11 | deploy: 12 | name: Deploy to GitHub Pages 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v2 16 | - uses: actions/setup-node@v3 17 | with: 18 | node-version: 18.x 19 | cache: npm 20 | 21 | - name: Install dependencies 22 | run: npm ci 23 | - name: Build website 24 | run: npm run build 25 | 26 | # Popular action to deploy to GitHub Pages: 27 | # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus 28 | - name: Deploy to GitHub Pages 29 | uses: peaceiris/actions-gh-pages@v3 30 | with: 31 | github_token: ${{ secrets.GITHUB_TOKEN }} 32 | # Build output to publish to the `gh-pages` branch: 33 | publish_dir: ./build 34 | # The following lines assign commit authorship to the official 35 | # GH-Actions bot for deploys to `gh-pages` branch: 36 | # https://github.com/actions/checkout/issues/13#issuecomment-724415212 37 | # The GH actions bot is used by default if you didn't specify the two fields. 38 | # You can swap them out with your own user credentials. 39 | user_name: github-actions[bot] 40 | user_email: 41898282+github-actions[bot]@users.noreply.github.com -------------------------------------------------------------------------------- /docs/doc/intro.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # Tutorial Intro 6 | 7 | Let's discover **Docusaurus in less than 5 minutes**. 8 | 9 | ## Getting Started 10 | 11 | Get started by **creating a new site**. 12 | 13 | Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**. 14 | 15 | ### What you'll need 16 | 17 | - [Node.js](https://nodejs.org/en/download/) version 14 or above: 18 | - When installing Node.js, you are recommended to check all checkboxes related to dependencies. 19 | 20 | ## Generate a new site 21 | 22 | Generate a new Docusaurus site using the **classic template**. 23 | 24 | The classic template will automatically be added to your project after you run the command: 25 | 26 | ```bash 27 | npm init docusaurus@latest my-website classic 28 | ``` 29 | 30 | You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor. 31 | 32 | The command also installs all necessary dependencies you need to run Docusaurus. 33 | 34 | ## Start your site 35 | 36 | Run the development server: 37 | 38 | ```bash 39 | cd my-website 40 | npm run start 41 | ``` 42 | 43 | The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there. 44 | 45 | The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/. 46 | 47 | Open `docs/doc/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes. 48 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/doc/intro.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # Tutorial Intro 6 | 7 | Let's discover **Docusaurus in less than 5 minutes**. 8 | 9 | ## Getting Started 10 | 11 | Get started by **creating a new site**. 12 | 13 | Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**. 14 | 15 | ### What you'll need 16 | 17 | - [Node.js](https://nodejs.org/en/download/) version 14 or above: 18 | - When installing Node.js, you are recommended to check all checkboxes related to dependencies. 19 | 20 | ## Generate a new site 21 | 22 | Generate a new Docusaurus site using the **classic template**. 23 | 24 | The classic template will automatically be added to your project after you run the command: 25 | 26 | ```bash 27 | npm init docusaurus@latest my-website classic 28 | ``` 29 | 30 | You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor. 31 | 32 | The command also installs all necessary dependencies you need to run Docusaurus. 33 | 34 | ## Start your site 35 | 36 | Run the development server: 37 | 38 | ```bash 39 | cd my-website 40 | npm run start 41 | ``` 42 | 43 | The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there. 44 | 45 | The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/. 46 | 47 | Open `docs/doc/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes. 48 | -------------------------------------------------------------------------------- /src/components/WebsiteCount/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useState } from 'react' 2 | import { jsonp } from 'src/utils/jsonp' 3 | 4 | import styles from './styles.module.css' 5 | 6 | const SvgViewsArticle = require('@site/static/img/views_article.svg').default 7 | const SvgViewsUser = require('@site/static/img/views_user.svg').default 8 | const SvgViewsSite = require('@site/static/img/views_site.svg').default 9 | 10 | interface BusuanziData { 11 | page_pv: number 12 | site_pv: number 13 | site_uv: number 14 | version: number 15 | } 16 | 17 | export default function WebsiteCount(): JSX.Element { 18 | const [pagePV, setPagePV] = useState(0) 19 | const [siteUV, setSiteUV] = useState(0) 20 | const [sitePV, setSitePV] = useState(0) 21 | 22 | const loadData = async () => { 23 | const data = await jsonp.get('//busuanzi.ibruce.info/busuanzi', { 24 | callbackParam: 'jsonpCallback', 25 | }) 26 | if (data) { 27 | setPagePV(data.page_pv) 28 | setSiteUV(data.site_uv) 29 | setSitePV(data.site_pv) 30 | } 31 | } 32 | 33 | useEffect(() => { 34 | loadData() 35 | }, []) 36 | 37 | return ( 38 |
39 | {/* 所有页面的总访问次数 */} 40 |
41 | 42 | {sitePV} 43 |
44 | {/* 当前文章访问数量 */} 45 |
46 | 47 | {pagePV} 48 |
49 | {/* 站点访客人数 */} 50 |
51 | 52 | {siteUV} 53 |
54 |
55 | ) 56 | } 57 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-theme-classic/footer.json: -------------------------------------------------------------------------------- 1 | { 2 | "link.title.Docs": { 3 | "message": "Docs", 4 | "description": "The title of the footer links column with title=Docs in the footer" 5 | }, 6 | "link.title.Community": { 7 | "message": "Community", 8 | "description": "The title of the footer links column with title=Community in the footer" 9 | }, 10 | "link.title.More": { 11 | "message": "More", 12 | "description": "The title of the footer links column with title=More in the footer" 13 | }, 14 | "link.item.label.Tutorial": { 15 | "message": "Tutorial", 16 | "description": "The label of footer link with label=Tutorial linking to /docs/doc/intro" 17 | }, 18 | "link.item.label.Stack Overflow": { 19 | "message": "Stack Overflow", 20 | "description": "The label of footer link with label=Stack Overflow linking to https://stackoverflow.com/questions/tagged/docusaurus" 21 | }, 22 | "link.item.label.Discord": { 23 | "message": "Discord", 24 | "description": "The label of footer link with label=Discord linking to https://discordapp.com/invite/docusaurus" 25 | }, 26 | "link.item.label.Twitter": { 27 | "message": "Twitter", 28 | "description": "The label of footer link with label=Twitter linking to https://twitter.com/docusaurus" 29 | }, 30 | "link.item.label.Blog": { 31 | "message": "Blog", 32 | "description": "The label of footer link with label=Blog linking to /blog" 33 | }, 34 | "link.item.label.GitHub": { 35 | "message": "GitHub", 36 | "description": "The label of footer link with label=GitHub linking to https://github.com/facebook/docusaurus" 37 | }, 38 | "copyright": { 39 | "message": "Copyright © 2023 My Project, Inc. Built with Docusaurus.", 40 | "description": "The footer copyright" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /docs/doc/tutorial-extras/translate-your-site.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Translate your site 6 | 7 | Let's translate `docs/intro.md` to French. 8 | 9 | ## Configure i18n 10 | 11 | Modify `docusaurus.config.js` to add support for the `fr` locale: 12 | 13 | ```js title="docusaurus.config.js" 14 | module.exports = { 15 | i18n: { 16 | defaultLocale: 'en', 17 | locales: ['en', 'fr'], 18 | }, 19 | }; 20 | ``` 21 | 22 | ## Translate a doc 23 | 24 | Copy the `docs/doc/intro.md` file to the `i18n/fr` folder: 25 | 26 | ```bash 27 | mkdir -p i18n/fr/docusaurus-plugin-content-docs/current/ 28 | 29 | cp docs/intro.md i18n/fr/docusaurus-plugin-content-docs/current/intro.md 30 | ``` 31 | 32 | Translate `i18n/fr/docusaurus-plugin-content-docs/current/intro.md` in French. 33 | 34 | ## Start your localized site 35 | 36 | Start your site on the French locale: 37 | 38 | ```bash 39 | npm run start -- --locale fr 40 | ``` 41 | 42 | Your localized site is accessible at `http://localhost:3000/fr/` and the `Getting Started` page is translated. 43 | 44 | :::caution 45 | 46 | In development, you can only use one locale at a same time. 47 | 48 | ::: 49 | 50 | ## Add a Locale Dropdown 51 | 52 | To navigate seamlessly across languages, add a locale dropdown. 53 | 54 | Modify the `docusaurus.config.js` file: 55 | 56 | ```js title="docusaurus.config.js" 57 | module.exports = { 58 | themeConfig: { 59 | navbar: { 60 | items: [ 61 | // highlight-start 62 | { 63 | type: 'localeDropdown', 64 | }, 65 | // highlight-end 66 | ], 67 | }, 68 | }, 69 | }; 70 | ``` 71 | 72 | The locale dropdown now appears in your navbar: 73 | 74 | ![Locale Dropdown](/img/tutorial/localeDropdown.png) 75 | 76 | ## Build your localized site 77 | 78 | Build your site for a specific locale: 79 | 80 | ```bash 81 | npm run build -- --locale fr 82 | ``` 83 | 84 | Or build your site to include all the locales at once: 85 | 86 | ```bash 87 | npm run build 88 | ``` 89 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/doc/tutorial-extras/translate-your-site.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Translate your site 6 | 7 | Let's translate `docs/intro.md` to French. 8 | 9 | ## Configure i18n 10 | 11 | Modify `docusaurus.config.js` to add support for the `fr` locale: 12 | 13 | ```js title="docusaurus.config.js" 14 | module.exports = { 15 | i18n: { 16 | defaultLocale: 'en', 17 | locales: ['en', 'fr'], 18 | }, 19 | }; 20 | ``` 21 | 22 | ## Translate a doc 23 | 24 | Copy the `docs/doc/intro.md` file to the `i18n/fr` folder: 25 | 26 | ```bash 27 | mkdir -p i18n/fr/docusaurus-plugin-content-docs/current/ 28 | 29 | cp docs/intro.md i18n/fr/docusaurus-plugin-content-docs/current/intro.md 30 | ``` 31 | 32 | Translate `i18n/fr/docusaurus-plugin-content-docs/current/intro.md` in French. 33 | 34 | ## Start your localized site 35 | 36 | Start your site on the French locale: 37 | 38 | ```bash 39 | npm run start -- --locale fr 40 | ``` 41 | 42 | Your localized site is accessible at `http://localhost:3000/fr/` and the `Getting Started` page is translated. 43 | 44 | :::caution 45 | 46 | In development, you can only use one locale at a same time. 47 | 48 | ::: 49 | 50 | ## Add a Locale Dropdown 51 | 52 | To navigate seamlessly across languages, add a locale dropdown. 53 | 54 | Modify the `docusaurus.config.js` file: 55 | 56 | ```js title="docusaurus.config.js" 57 | module.exports = { 58 | themeConfig: { 59 | navbar: { 60 | items: [ 61 | // highlight-start 62 | { 63 | type: 'localeDropdown', 64 | }, 65 | // highlight-end 66 | ], 67 | }, 68 | }, 69 | }; 70 | ``` 71 | 72 | The locale dropdown now appears in your navbar: 73 | 74 | ![Locale Dropdown](/img/tutorial/localeDropdown.png) 75 | 76 | ## Build your localized site 77 | 78 | Build your site for a specific locale: 79 | 80 | ```bash 81 | npm run build -- --locale fr 82 | ``` 83 | 84 | Or build your site to include all the locales at once: 85 | 86 | ```bash 87 | npm run build 88 | ``` 89 | -------------------------------------------------------------------------------- /src/components/HomepageFeatures/index.tsx: -------------------------------------------------------------------------------- 1 | import clsx from 'clsx' 2 | import React from 'react' 3 | 4 | import styles from './styles.module.css' 5 | 6 | type FeatureItem = { 7 | key: number 8 | title: string 9 | Svg: React.ComponentType> 10 | description: JSX.Element 11 | } 12 | 13 | const FeatureList: FeatureItem[] = [ 14 | { 15 | key: 1, 16 | title: 'Easy to Use', 17 | Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, 18 | description: ( 19 | <> 20 | Zain Docusaurus was designed from the ground up to be easily installed and used to get your website up and 21 | running quickly. 22 | 23 | ), 24 | }, 25 | { 26 | key: 2, 27 | title: 'Focus on What Matters', 28 | Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default, 29 | description: ( 30 | <> 31 | Docusaurus lets you focus on your docs, and we'll do the chores. Go ahead and move your docs into the{' '} 32 | docs directory. 33 | 34 | ), 35 | }, 36 | { 37 | key: 3, 38 | title: 'Powered by React', 39 | Svg: require('@site/static/img/undraw_docusaurus_react.svg').default, 40 | description: ( 41 | <> 42 | Extend or customize your website layout by reusing React. Docusaurus can be extended while reusing the same 43 | header and footer. 44 | 45 | ), 46 | }, 47 | ] 48 | 49 | interface FeatureItemProps { 50 | title: string 51 | Svg: React.ComponentType> 52 | description: JSX.Element 53 | } 54 | 55 | function Feature(props: FeatureItemProps) { 56 | const { title, Svg, description } = props 57 | 58 | return ( 59 |
60 |
61 | 62 |
63 |
64 |

{title}

65 |

{description}

66 |
67 |
68 | ) 69 | } 70 | 71 | export default function HomepageFeatures(): JSX.Element { 72 | return ( 73 |
74 |
75 |
76 | {FeatureList.map((item) => ( 77 | 78 | ))} 79 |
80 |
81 |
82 | ) 83 | } 84 | -------------------------------------------------------------------------------- /src/utils/jsonp.ts: -------------------------------------------------------------------------------- 1 | declare global { 2 | interface Window { 3 | [key: string]: unknown 4 | } 5 | } 6 | 7 | export interface JsonpOptions { 8 | callbackParam?: string 9 | callbackFunctionName?: string 10 | timeoutDuration?: number 11 | } 12 | 13 | class Jsonp { 14 | constructor() { 15 | this.options = {} 16 | this.timer = null 17 | this.scriptElement = null 18 | } 19 | 20 | private options: JsonpOptions 21 | 22 | private timer: NodeJS.Timeout | null 23 | 24 | private scriptElement: HTMLScriptElement | null 25 | 26 | public get(url: string, options?: JsonpOptions) { 27 | return new Promise((resolve, reject) => { 28 | this.access(url, options || {}, (data: T | null, error: Error | null) => { 29 | if (error) { 30 | reject(error) 31 | } 32 | if (data) { 33 | resolve(data) 34 | } 35 | }) 36 | }) 37 | } 38 | 39 | private access(url: string, options: JsonpOptions, fn: (data: T | null, error: Error | null) => void) { 40 | const uniqueString = Date.now().toString(36) + Math.random().toString(36).slice(2, 7) 41 | 42 | this.options = { 43 | callbackParam: options.callbackParam || 'jsonpCallback', 44 | callbackFunctionName: options.callbackFunctionName || `callbackFunction_${uniqueString}`, 45 | timeoutDuration: options.timeoutDuration || 60 * 1000, 46 | } 47 | 48 | this.timer = setTimeout(() => { 49 | this.cleanup() 50 | fn(null, new Error('Timeout')) 51 | }, this.options.timeoutDuration) 52 | 53 | if (this.options.callbackFunctionName) { 54 | window[this.options.callbackFunctionName] = (data: T) => { 55 | this.cleanup() 56 | fn(data, null) 57 | } 58 | } 59 | 60 | let newUrl = url 61 | newUrl += `${(url.indexOf('?') === -1 ? '?' : '&') + this.options.callbackParam}=${ 62 | this.options.callbackFunctionName 63 | }` 64 | newUrl = newUrl.replace('?&', '?') 65 | 66 | const targetElement = document.getElementsByTagName('script')[0] || document.head 67 | this.scriptElement = document.createElement('script') 68 | this.scriptElement.src = newUrl 69 | this.scriptElement.type = 'text/javascript' 70 | this.scriptElement.defer = true 71 | this.scriptElement.referrerPolicy = 'no-referrer-when-downgrade' 72 | targetElement.parentNode?.insertBefore(this.scriptElement, targetElement) 73 | } 74 | 75 | public cleanup() { 76 | if (this.scriptElement?.parentNode) { 77 | this.scriptElement.parentNode.removeChild(this.scriptElement) 78 | } 79 | if (this.options.callbackFunctionName) { 80 | delete window[this.options.callbackFunctionName] 81 | } 82 | if (this.timer) { 83 | clearTimeout(this.timer) 84 | } 85 | } 86 | } 87 | 88 | export const jsonp = new Jsonp() 89 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/note/github-multiple-connection.md: -------------------------------------------------------------------------------- 1 | # Github 多账号连接 2 | 3 | 教程展示 2 个 github 账号, 使用 ssh key 的方式拉取代码, 多个账号方法依次类推. 4 | 5 | ## 生成两个 SSH key 6 | 7 | ### 注意事项 8 | 9 | 1. 运行两次这个命令 10 | 2. 邮箱分别填写不同的, 需要连接的 `Github` 账号邮箱 11 | 3. 回车后, 第一个提示输入 `key`, 分别输入不同的路径名称, 示例: `/Users/zainjane[用户名]/.ssh/id_zain[生成的文件名]` 12 | 4. 其它提示都默认回车就可以了 13 | 14 | ```bash 15 | ssh-keygen -t ed25519 -C "your_email@example.com" 16 | ``` 17 | 18 | ### 成果 19 | 20 | 最终会在 `/Users/zainjane[用户名]/.ssh/` 目录下, 生成四个文件, 类似: 21 | 22 | ``` 23 | id_zain 24 | id_zain.pub 25 | id_jane 26 | id_jane.pub 27 | ``` 28 | 29 | ## Github 配置公钥 30 | 31 | 将 `id_zain.pub` 和 `id_jane.pub` 中的内容, 分别配置到 `Github` 账号的 SSH 设置中. 32 | 33 | 可参考官方或其它教程: [新增 SSH 密钥到 GitHub 帐户](https://docs.github.com/cn/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account) 34 | 35 | ## 添加 SSH 配置文件 36 | 37 | 在 `/Users/zainjane[用户名]/.ssh/` 目录下, 新增 `config` 文件 38 | 39 | 在 `config` 文件中写入下列内容 40 | 41 | ```bash 42 | # zain 43 | Host zain.github.com 44 | Hostname github.com 45 | IdentityFile ~/.ssh/id_zain 46 | User zain 47 | 48 | # jane 49 | Host jane.github.com 50 | Hostname github.com 51 | IdentityFile ~/.ssh/id_jane 52 | User jane 53 | ``` 54 | 55 | ## 测试 SSH 连接 56 | 57 | ```bash 58 | ssh -T git@zain.github.com 59 | ssh -T git@jane.github.com 60 | ``` 61 | 62 | 出现下列提示, 连接正常: 63 | 64 | Hi ZainChen! You've successfully authenticated, but GitHub does not provide shell access. 65 | 66 | Hi JaneMe! You've successfully authenticated, but GitHub does not provide shell access. 67 | 68 | ## Git 远程分支链接设置 69 | 70 | 修改在 `Github` 上复制到的 `SSH` 链接 71 | 72 | ```bash 73 | git@github.com:ZainChen/zaindoc.git 74 | # 修改成下面的样子(根据需要连接的不同 Github 账号, 修改成 config 中设置的不同 Host) 75 | git@zain.github.com:ZainChen/zaindoc.git 76 | 77 | # 拉取项目直接 78 | git clone git@zain.github.com:ZainChen/zaindoc.git 79 | ``` 80 | 81 | ## 通过 HTTPS 端口使用 SSH 82 | 83 | 防火墙或其它原因可能导致 `SSH` 连接超时. 84 | 85 | 可尝试通过 `HTTPS` 端口, 建立 `SSH` 连接. 86 | 87 | ### HTTPS 端口测试 88 | 89 | ```bash 90 | ssh -T -p 443 git@ssh.github.com 91 | ``` 92 | 93 | 出现下列提示, 说明可以通过 `HTTPS` 端口使用 `SSH` 94 | 95 | Hi username! You've successfully authenticated, but GitHub does not provide shell access. 96 | 97 | ### 通过 HTTPS 启用 SSH 连接 98 | 99 | 修改或添加 `/Users/zainjane[用户名]/.ssh/` 目录下, `config` 文件 100 | 101 | ```bash 102 | # zain 103 | Host zain.github.com 104 | Hostname ssh.github.com 105 | Port 443 106 | IdentityFile ~/.ssh/id_zain 107 | User zain 108 | 109 | # jane 110 | Host jane.github.com 111 | Hostname ssh.github.com 112 | Port 443 113 | IdentityFile ~/.ssh/id_jane 114 | User jane 115 | ``` 116 | 117 | 设置好后, 可使用上放的 `测试 SSH 连接` 命令, 进行测试. 118 | 119 | ## 参考资料 120 | 121 | - [生成新的 SSH 密钥](https://docs.github.com/cn/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key) 122 | - [新增 SSH 密钥到 GitHub 帐户](https://docs.github.com/cn/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account) 123 | - [通过 HTTPS 端口使用 SSH](https://docs.github.com/en/authentication/troubleshooting-ssh/using-ssh-over-the-https-port) 124 | -------------------------------------------------------------------------------- /blog/2019-05-29-long-blog-post.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: long-blog-post 3 | title: Long Blog Post 4 | authors: endi 5 | tags: [hello, docusaurus] 6 | --- 7 | 8 | This is the summary of a very long blog post, 9 | 10 | Use a `` comment to limit blog post size in the list view. 11 | 12 | 13 | 14 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 15 | 16 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 17 | 18 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 19 | 20 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 21 | 22 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 23 | 24 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 25 | 26 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 27 | 28 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 29 | 30 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 31 | 32 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 33 | 34 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 35 | 36 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 37 | 38 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 39 | 40 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 41 | 42 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 43 | 44 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 45 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-blog/2019-05-29-long-blog-post.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: long-blog-post 3 | title: Long Blog Post 4 | authors: endi 5 | tags: [hello, docusaurus] 6 | --- 7 | 8 | This is the summary of a very long blog post, 9 | 10 | Use a `` comment to limit blog post size in the list view. 11 | 12 | 13 | 14 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 15 | 16 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 17 | 18 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 19 | 20 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 21 | 22 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 23 | 24 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 25 | 26 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 27 | 28 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 29 | 30 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 31 | 32 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 33 | 34 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 35 | 36 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 37 | 38 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 39 | 40 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 41 | 42 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 43 | 44 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 45 | -------------------------------------------------------------------------------- /docs/doc/tutorial-basics/markdown-features.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 4 3 | --- 4 | 5 | # Markdown Features 6 | 7 | Docusaurus supports **[Markdown](https://daringfireball.net/projects/markdown/syntax)** and a few **additional features**. 8 | 9 | ## Front Matter 10 | 11 | Markdown documents have metadata at the top called [Front Matter](https://jekyllrb.com/docs/front-matter/): 12 | 13 | ```text title="my-doc.md" 14 | // highlight-start 15 | --- 16 | id: my-doc-id 17 | title: My document title 18 | description: My document description 19 | slug: /my-custom-url 20 | --- 21 | // highlight-end 22 | 23 | ## Markdown heading 24 | 25 | Markdown text with [links](./hello.md) 26 | ``` 27 | 28 | ## Links 29 | 30 | Regular Markdown links are supported, using url paths or relative file paths. 31 | 32 | ```md 33 | Let's see how to [Create a page](/create-a-page). 34 | ``` 35 | 36 | ```md 37 | Let's see how to [Create a page](./create-a-page.md). 38 | ``` 39 | 40 | **Result:** Let's see how to [Create a page](./create-a-page.md). 41 | 42 | ## Images 43 | 44 | Regular Markdown images are supported. 45 | 46 | Add an image at `static/img/docusaurus.png` and display it in Markdown: 47 | 48 | ```md 49 | ![Docusaurus logo](/img/docusaurus.png) 50 | ``` 51 | 52 | ![Docusaurus logo](/img/docusaurus.png) 53 | 54 | ## Code Blocks 55 | 56 | Markdown code blocks are supported with Syntax highlighting. 57 | 58 | ```jsx title="src/components/HelloDocusaurus.js" 59 | function HelloDocusaurus() { 60 | return ( 61 |

Hello, Docusaurus!

62 | ) 63 | } 64 | ``` 65 | 66 | ```jsx title="src/components/HelloDocusaurus.js" 67 | function HelloDocusaurus() { 68 | return

Hello, Docusaurus!

; 69 | } 70 | ``` 71 | 72 | ## Admonitions 73 | 74 | Docusaurus has a special syntax to create admonitions and callouts: 75 | 76 | :::tip My tip 77 | 78 | Use this awesome feature option 79 | 80 | ::: 81 | 82 | :::danger Take care 83 | 84 | This action is dangerous 85 | 86 | ::: 87 | 88 | :::tip My tip 89 | 90 | Use this awesome feature option 91 | 92 | ::: 93 | 94 | :::danger Take care 95 | 96 | This action is dangerous 97 | 98 | ::: 99 | 100 | ## MDX and React Components 101 | 102 | [MDX](https://mdxjs.com/) can make your documentation more **interactive** and allows using any **React components inside Markdown**: 103 | 104 | ```jsx 105 | export const Highlight = ({children, color}) => ( 106 | { 115 | alert(`You clicked the color ${color} with label ${children}`) 116 | }}> 117 | {children} 118 | 119 | ); 120 | 121 | This is Docusaurus green ! 122 | 123 | This is Facebook blue ! 124 | ``` 125 | 126 | export const Highlight = ({children, color}) => ( 127 | { 136 | alert(`You clicked the color ${color} with label ${children}`); 137 | }}> 138 | {children} 139 | 140 | ); 141 | 142 | This is Docusaurus green ! 143 | 144 | This is Facebook blue ! 145 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/doc/tutorial-basics/markdown-features.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 4 3 | --- 4 | 5 | # Markdown Features 6 | 7 | Docusaurus supports **[Markdown](https://daringfireball.net/projects/markdown/syntax)** and a few **additional features**. 8 | 9 | ## Front Matter 10 | 11 | Markdown documents have metadata at the top called [Front Matter](https://jekyllrb.com/docs/front-matter/): 12 | 13 | ```text title="my-doc.md" 14 | // highlight-start 15 | --- 16 | id: my-doc-id 17 | title: My document title 18 | description: My document description 19 | slug: /my-custom-url 20 | --- 21 | // highlight-end 22 | 23 | ## Markdown heading 24 | 25 | Markdown text with [links](./hello.md) 26 | ``` 27 | 28 | ## Links 29 | 30 | Regular Markdown links are supported, using url paths or relative file paths. 31 | 32 | ```md 33 | Let's see how to [Create a page](/create-a-page). 34 | ``` 35 | 36 | ```md 37 | Let's see how to [Create a page](./create-a-page.md). 38 | ``` 39 | 40 | **Result:** Let's see how to [Create a page](./create-a-page.md). 41 | 42 | ## Images 43 | 44 | Regular Markdown images are supported. 45 | 46 | Add an image at `static/img/docusaurus.png` and display it in Markdown: 47 | 48 | ```md 49 | ![Docusaurus logo](/img/docusaurus.png) 50 | ``` 51 | 52 | ![Docusaurus logo](/img/docusaurus.png) 53 | 54 | ## Code Blocks 55 | 56 | Markdown code blocks are supported with Syntax highlighting. 57 | 58 | ```jsx title="src/components/HelloDocusaurus.js" 59 | function HelloDocusaurus() { 60 | return ( 61 |

Hello, Docusaurus!

62 | ) 63 | } 64 | ``` 65 | 66 | ```jsx title="src/components/HelloDocusaurus.js" 67 | function HelloDocusaurus() { 68 | return

Hello, Docusaurus!

; 69 | } 70 | ``` 71 | 72 | ## Admonitions 73 | 74 | Docusaurus has a special syntax to create admonitions and callouts: 75 | 76 | :::tip My tip 77 | 78 | Use this awesome feature option 79 | 80 | ::: 81 | 82 | :::danger Take care 83 | 84 | This action is dangerous 85 | 86 | ::: 87 | 88 | :::tip My tip 89 | 90 | Use this awesome feature option 91 | 92 | ::: 93 | 94 | :::danger Take care 95 | 96 | This action is dangerous 97 | 98 | ::: 99 | 100 | ## MDX and React Components 101 | 102 | [MDX](https://mdxjs.com/) can make your documentation more **interactive** and allows using any **React components inside Markdown**: 103 | 104 | ```jsx 105 | export const Highlight = ({children, color}) => ( 106 | { 115 | alert(`You clicked the color ${color} with label ${children}`) 116 | }}> 117 | {children} 118 | 119 | ); 120 | 121 | This is Docusaurus green ! 122 | 123 | This is Facebook blue ! 124 | ``` 125 | 126 | export const Highlight = ({children, color}) => ( 127 | { 136 | alert(`You clicked the color ${color} with label ${children}`); 137 | }}> 138 | {children} 139 | 140 | ); 141 | 142 | This is Docusaurus green ! 143 | 144 | This is Facebook blue ! 145 | -------------------------------------------------------------------------------- /docs/note/github-multiple-connection.md: -------------------------------------------------------------------------------- 1 | # Connecting multiple Github accounts 2 | 3 | This tutorial shows how to connect 2 Github accounts and pull code using SSH keys. The method for connecting multiple accounts is similar. 4 | 5 | ## Generating two SSH keys 6 | 7 | ### Precautions 8 | 9 | 1. Run this command twice. 10 | 2. Fill in different email addresses for each Github account. 11 | 3. After pressing enter, the first prompt asks for a 'key'. Enter a different path name each time, for example: `/Users/zainjane[Username]/.ssh/id_zain[Generated file name]`. 12 | 4. Hit enter for all other prompts. 13 | 14 | ```bash 15 | ssh-keygen -t ed25519 -C "your_email@example.com" 16 | ``` 17 | 18 | ### Result 19 | 20 | Four files will be generated in the directory `/Users/zainjane[Username]/.ssh/`, like: 21 | 22 | ``` 23 | id_zain 24 | id_zain.pub 25 | id_jane 26 | id_jane.pub 27 | ``` 28 | 29 | ## Configuring public keys in Github 30 | 31 | Configure the contents of `id_zain.pub` and `id_jane.pub` into the SSH settings of the `Github` account. 32 | 33 | References can be made to official or other tutorials: [Add SSH key to GitHub account](https://docs.github.com/cn/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account) 34 | 35 | ## Adding an SSH configuration file 36 | 37 | In the `/Users/zainjane[username]/.ssh/` directory, add a new `config` file 38 | 39 | Write the following content in the `config` file 40 | 41 | ```bash 42 | # zain 43 | Host zain.github.com 44 | Hostname github.com 45 | IdentityFile ~/.ssh/id_zain 46 | User zain 47 | 48 | # jane 49 | Host jane.github.com 50 | Hostname github.com 51 | IdentityFile ~/.ssh/id_jane 52 | User jane 53 | ``` 54 | 55 | ## Testing SSH connection 56 | 57 | ```bash 58 | ssh -T git@zain.github.com 59 | ssh -T git@jane.github.com 60 | ``` 61 | 62 | If successful, the following prompt should appear: 63 | 64 | Hi ZainChen! You've successfully authenticated, but GitHub does not provide shell access. 65 | 66 | Hi JaneMe! You've successfully authenticated, but GitHub does not provide shell access. 67 | 68 | ## Setting up Git remote branch links 69 | 70 | Modify the `SSH` link copied on `Github`: 71 | 72 | ```bash 73 | git@github.com:ZainChen/zaindoc.git 74 | # Change it to the following format (according to the different Github accounts to be connected, modify it to the different Host set in 'config') 75 | git@zain.github.com:ZainChen/zaindoc.git 76 | 77 | # To pull the project directly: 78 | git clone git@zain.github.com:ZainChen/zaindoc.git 79 | ``` 80 | 81 | ## Using SSH through HTTPS port 82 | 83 | Firewalls or other reasons may cause `SSH` connection timeout. 84 | 85 | You can try to establish an `SSH` connection through the `HTTPS` port. 86 | 87 | ### HTTPS port test 88 | 89 | ```bash 90 | ssh -T -p 443 git@ssh.github.com 91 | ``` 92 | 93 | If successful, the following prompt should appear: 94 | 95 | Hi username! You've successfully authenticated, but GitHub does not provide shell access. 96 | 97 | ### Enabling SSH connection through HTTPS 98 | 99 | Modify or add a `config` file in the directory `/Users/zainjane[Username]/.ssh/`. 100 | 101 | ```bash 102 | # zain 103 | Host zain.github.com 104 | Hostname ssh.github.com 105 | Port 443 106 | IdentityFile ~/.ssh/id_zain 107 | User zain 108 | 109 | # jane 110 | Host jane.github.com 111 | Hostname ssh.github.com 112 | Port 443 113 | IdentityFile ~/.ssh/id_jane 114 | User jane 115 | ``` 116 | 117 | After setting up, use the `Testing SSH Connection` command above to test. 118 | 119 | ## References 120 | 121 | - [Generating a new SSH key and adding it to the SSH agent](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) 122 | - [Adding a new SSH key to your GitHub account](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account) 123 | - [Using SSH over the HTTPS port](https://docs.github.com/en/authentication/troubleshooting-ssh/using-ssh-over-the-https-port) 124 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/note/other/markdown-guide.md: -------------------------------------------------------------------------------- 1 | # Markdown 使用说明 2 | 3 | --- 4 | 5 | ## 标题 6 | 7 | > 标准语法一般在 `#` 后跟个空格再写文字 8 | 9 | ```markdown 10 | # 这是一级标题 11 | ## 这是二级标题 12 | ### 这是三级标题 13 | #### 这是四级标题 14 | ##### 这是五级标题 15 | ###### 这是六级标题 16 | ``` 17 | 18 | 示例: 19 | 20 | # 这是一级标题 21 | ## 这是二级标题 22 | ### 这是三级标题 23 | #### 这是四级标题 24 | ##### 这是五级标题 25 | ###### 这是六级标题 26 | 27 | --- 28 | 29 | ## 字体 30 | 31 | ```markdown 32 | **这是加粗的文字** 33 | *这是倾斜的文字*` 34 | ***这是斜体加粗的文字*** 35 | ~~这是加删除线的文字~~ 36 | ``` 37 | 38 | 示例: 39 | 40 | **这是加粗的文字** 41 | 42 | *这是倾斜的文字* 43 | 44 | ***这是斜体加粗的文字*** 45 | 46 | ~~这是加删除线的文字~~ 47 | 48 | --- 49 | 50 | ## 引用 51 | 52 | > 引用文字前加 `>` 即可,引用可嵌套,如加两个 `>>` 三个 `>>>` n 个... 53 | 54 | ```markdown 55 | >这是引用的内容 56 | >>这是引用的内容 57 | >> 58 | >>>>>>>>>>这是引用的内容 59 | ``` 60 | 61 | 示例: 62 | 63 | >这是引用的内容 64 | >>这是引用的内容 65 | >> 66 | >>>>>>>>>>这是引用的内容 67 | 68 | --- 69 | 70 | ## 分割线 71 | 72 | > 三个或者三个以上 `-` 或者 `*` 都 ok 73 | 74 | ```markdown 75 | ---- 76 | *** 77 | ***** 78 | ``` 79 | 80 | 示例: 81 | 82 | ---- 83 | *** 84 | ***** 85 | 86 | ## 图片 87 | 88 | ### 方法1 89 | 90 | > 无法修改图片大小 91 | 92 | 图片alt:显示在图片下面的文字,对图片内容的解释(可加可不加,Typora无效) 93 | 94 | 图片title:图片的标题,当鼠标移到图片上时显示的内容(可加可不加,Typora无效) 95 | 96 | ```markdown 97 | ![图片alt](图片地址 "图片title") 98 | ``` 99 | 100 | 示例: 101 | 102 | ![志银](https://zainchen.github.io/zaindoc/zh-CN/img/logo.jpeg "志银") 103 | 104 | ### 方法2 105 | 106 | > 直接用 `html` 标签,可修改图片大小 107 | 108 | ```html 109 | 志银 110 | ``` 111 | 112 | 志银 113 | 114 | --- 115 | 116 | ## 超链接 117 | 118 | ### 方法1 119 | 120 | > `title` 可加可不加 121 | 122 | ```markdown 123 | [超链接名](超链接地址 "超链接title") 124 | ``` 125 | 126 | 示例: 127 | 128 | [简书](http://jianshu.com) 129 | [百度](http://baidu.com) 130 | 131 | ### 方法2 132 | 133 | ```html 134 | 超链接名 135 | ``` 136 | 137 | 示例: 138 | 简书 139 | 140 | --- 141 | 142 | ## 列表 143 | 144 | ### 无序列表 145 | 146 | > `-` `+` `*` 任何一种都可以(`-` `+` `*` 与内容之间要加一个空格) 147 | 148 | ```markdown 149 | - 列表内容 150 | + 列表内容 151 | * 列表内容 152 | ``` 153 | 154 | 示例: 155 | 156 | - 列表内容 157 | + 列表内容 158 | * 列表内容 159 | 160 | ### 有序列表 161 | 162 | > 序号与内容之间要加一个空格 163 | 164 | ```markdown 165 | 1. 列表内容 166 | 2. 列表内容 167 | 3. 列表内容 168 | ``` 169 | 170 | 示例: 171 | 172 | 1. 列表内容 173 | 2. 列表内容 174 | 3. 列表内容 175 | 176 | ### 列表嵌套 177 | 178 | > 上一级和下一级之间敲两个空格即可 179 | 180 | ```markdown 181 | - 列表内容 182 | - 列表内容 183 | - 列表内容 184 | - 列表内容 185 | - 列表内容 186 | + 列表内容 187 | * 列表内容 188 | ``` 189 | 190 | 示例: 191 | 192 | - 列表内容 193 | - 列表内容 194 | - 列表内容 195 | - 列表内容 196 | - 列表内容 197 | + 列表内容 198 | * 列表内容 199 | 200 | --- 201 | 202 | ## 表格 203 | 204 | 注: 205 | 206 | 第二行分割表头和内容(`-`有一个就行,为了对齐,多加了几个) 207 | 208 | 文字默认居左 209 | 210 | 表头分割符`-`两边加:文字居中 211 | 212 | 表头分割符`-`右边加:文字居右 213 | 214 | 表头分割符`-`左边加:文字居左 215 | 216 | (PS:原生的语法两边都要用 `| `包起来,此处省略) 217 | 218 | ```markdown 219 | 表头|表头|表头 220 | ---|:--:|--: 221 | 内容|内容|内容 222 | 内容|内容|内容 223 | ``` 224 | 225 | 示例: 226 | 227 | 表头|表头|表头 228 | ---|:--:|--: 229 | 内容|内容|内容 230 | 内容|内容|内容 231 | 232 | --- 233 | 234 | ## 代码 235 | 236 | ### 单行代码 237 | 238 | > 代码之间分别用一个反引号包起来 239 | 240 | ```markdown 241 | `代码内容` 242 | ``` 243 | 244 | 示例: 245 | 246 | `代码内容` 247 | 248 | ### 代码块 249 | 250 | > 代码之间分别用三个反引号包起来,且两边的反引号单独占一行 251 | 252 | ```markdown 253 | // `\` 是为防止语法生效的占位符 254 | \```cpp 255 | 代码块... 256 | 代码块... 257 | 代码块... 258 | \``` 259 | ``` 260 | 261 | 示例: 262 | 263 | ```cpp 264 | /* 265 | 二进制字符串转十进制 266 | 头文件: 267 | #include 268 | using namespace std; 269 | 参数: 270 | string s: 待转化二进制字符串 271 | 返回值: 272 | long long : 转换后的十进制数 273 | 例子: 274 | cout << BinaryToInt("000010101"); //21 275 | */ 276 | long long BinaryToInt(string s) { 277 | long long sum = 0; 278 | int k = 0; 279 | for(int i = s.size()-1; i >= 0; i--) { 280 | long long q = 1; 281 | for(int j = 1; j <= k; j++) { 282 | q *= 2; 283 | } 284 | sum += (s[i]-48)*q; 285 | k++; 286 | } 287 | return sum; 288 | } 289 | ``` 290 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Zaindoc 2 | 3 | ## 开发/构建/部署 4 | 5 | ```bash 6 | # 安装依赖 7 | npm i 8 | 9 | # 开发 10 | npm run start 11 | 12 | # 构建 13 | npm run build 14 | 15 | # 部署 16 | # 设置好 github ssh, 可直接用这条命令, 自动构建并 push 到 github 的 gh-pages 分支中触发页面更新 17 | USE_SSH=true npm run deploy 18 | ``` 19 | 20 | ### 自动部署配置 21 | 22 | 项目 main 分支的根目录, 添加下列两个文件: 23 | 24 | ```bash 25 | # main 分支 push 到 github, 自动触发构建的配置 26 | .github/workflows/deploy.yml 27 | 28 | # pull 拉取 main 分支, 自动触发构建的配置 29 | .github/workflows/test-deploy.yml 30 | ``` 31 | 32 | 详细说明: https://docusaurus.io/zh-CN/docs/deployment#triggering-deployment-with-github-actions 33 | 34 | ## 搜索 35 | 36 | ### 本地搜索 37 | 38 | 安装依赖包 39 | 40 | ```bash 41 | npm install --save @easyops-cn/docusaurus-search-local 42 | ``` 43 | 44 | 配置 docusaurus.config.js 45 | 46 | ```ts 47 | // In your `docusaurus.config.js`: 48 | module.exports = { 49 | // ... Your other configurations. 50 | themes: [ 51 | // ... Your other themes. 52 | [ 53 | require.resolve("@easyops-cn/docusaurus-search-local"), 54 | { 55 | // ... Your options. 56 | // `hashed` is recommended as long-term-cache of index file is possible. 57 | hashed: true, 58 | // For Docs using Chinese, The `language` is recommended to set to: 59 | // ``` 60 | language: ["en", "zh"], 61 | // ``` 62 | }, 63 | ], 64 | ], 65 | }; 66 | ``` 67 | 68 | 详细配置说明: https://github.com/easyops-cn/docusaurus-search-local 69 | 70 | ## 国际化 71 | 72 | ### 配置 docusaurus.config.js 73 | 74 | ```ts 75 | module.exports = { 76 | i18n: { 77 | defaultLocale: 'en', 78 | locales: ['en', 'zh-CN'], 79 | }, 80 | 81 | themeConfig: { 82 | navbar: { 83 | // 配置语言切换组件 84 | items: [ 85 | { 86 | type: 'localeDropdown', 87 | position: 'right', 88 | }, 89 | ], 90 | }, 91 | }, 92 | }; 93 | ``` 94 | 95 | ### 开发调试指定语言站点: 96 | 97 | ```bash 98 | # 调试中文站点 99 | npm run start -- --locale zh-CN 100 | ``` 101 | 102 | ### 翻译 103 | 104 | #### 翻译 Markdown 文件: 105 | 106 | ##### 翻译文档 107 | 108 | 将文档 Markdown 文件从 docs/ 复制到 i18n/zh-CN/docusaurus-plugin-content-docs/current,并翻译它们: 109 | 110 | ```bash 111 | mkdir -p i18n/zh-CN/docusaurus-plugin-content-docs/current 112 | cp -r docs/** i18n/zh-CN/docusaurus-plugin-content-docs/current 113 | ``` 114 | 115 | ##### 翻译博客 116 | 117 | 将文档 Markdown 文件从 docs/ 复制到 i18n/zh-CN/docusaurus-plugin-content-blog,并翻译它们: 118 | 119 | ```bash 120 | mkdir -p i18n/zh-CN/docusaurus-plugin-content-blog 121 | cp -r blog/** i18n/zh-CN/docusaurus-plugin-content-blog 122 | ``` 123 | 124 | ##### 翻译页面 125 | 126 | 将文档页面文件从 docs/ 复制到 i18n/zh-CN/docusaurus-plugin-content-pages,并翻译它们: 127 | 128 | ```bash 129 | mkdir -p i18n/zh-CN/docusaurus-plugin-content-pages 130 | cp -r src/pages/**.md i18n/zh-CN/docusaurus-plugin-content-pages 131 | cp -r src/pages/**.mdx i18n/zh-CN/docusaurus-plugin-content-pages 132 | ``` 133 | 134 | ##### 翻译内置组件文案 135 | 136 | 下列命令会自动翻译内置组件文案到 `i18n/zh-CN` 目录中 137 | 138 | ```bash 139 | npm run write-translations -- --locale zh-CN 140 | ``` 141 | 142 | ### 构建站点 143 | 144 | #### 单域名部署 145 | 146 | 构建站点还是用的加入国际化之前一样的命令 147 | 148 | ```bash 149 | npm run build 150 | ``` 151 | 152 | Docusaurus 将为每个语言版本构建一个单页面应用程序: 153 | 154 | - website/build:默认使用的英文语言 155 | - website/build/zh-cn:简体中文语言 156 | 157 | ### 踩坑记录 158 | 159 | 如果遇到类似下面的报错, 运行 `npm run write-translations -- --locale zh-CN`, 修改 `i18n/zh-CN` 中的文案, 删除前面这段 `One min read|` 160 | 161 | ```bash 162 | For locale=zh-CN, a maximum of 1 plural forms are expected (other), but the message contains 2: One min read|1 min read 163 | ``` 164 | 165 | 详细说明: https://docusaurus.io/zh-CN/docs/i18n/tutorial#single-domain-deployment 166 | 167 | ## 页面部署 168 | 169 | ### 国外 170 | 171 | 直接用 `github` 部署页面 172 | 173 | 页面地址: [https://zainchen.github.io/zaindoc](https://zainchen.github.io/zaindoc) 174 | 项目地址: [https://github.com/ZainChen/zaindoc](https://github.com/ZainChen/zaindoc) 175 | 176 | ### 国内 177 | 178 | 使用 `gitee` 部署页面 179 | 180 | 页面地址: [https://zainczy.gitee.io/zaindoc](https://zainczy.gitee.io/zaindoc) 181 | 项目地址: [https://gitee.com/zainczy/zaindoc](https://gitee.com/zainczy/zaindoc) 182 | 183 | ## 参考资料 184 | 185 | - 官方文档(多语言): https://docusaurus.io 186 | - 触发 GitHub Actions 自动部署: https://docusaurus.io/zh-CN/docs/deployment#triggering-deployment-with-github-actions 187 | - 本地搜索: https://github.com/easyops-cn/docusaurus-search-local 188 | - 国际化: https://docusaurus.io/zh-CN/docs/i18n/tutorial#single-domain-deployment 189 | -------------------------------------------------------------------------------- /i18n/zh-CN/docusaurus-plugin-content-docs/current/note/zaindoc/developer-guide.md: -------------------------------------------------------------------------------- 1 | # 开发指南 2 | 3 | ## 开发/构建/部署 4 | 5 | ```bash 6 | # 安装依赖 7 | npm i 8 | 9 | # 开发 10 | npm run start 11 | 12 | # 构建 13 | npm run build 14 | 15 | # 部署 16 | # 设置好 github ssh, 可直接用这条命令, 自动构建并 push 到 github 的 gh-pages 分支中触发页面更新 17 | USE_SSH=true npm run deploy 18 | ``` 19 | 20 | ### 自动部署配置 21 | 22 | 项目 main 分支的根目录, 添加下列两个文件: 23 | 24 | ```bash 25 | # main 分支 push 到 github, 自动触发构建的配置 26 | .github/workflows/deploy.yml 27 | 28 | # pull 拉取 main 分支, 自动触发构建的配置 29 | .github/workflows/test-deploy.yml 30 | ``` 31 | 32 | 详细说明: https://docusaurus.io/zh-CN/docs/deployment#triggering-deployment-with-github-actions 33 | 34 | ## 搜索 35 | 36 | ### 本地搜索 37 | 38 | 安装依赖包 39 | 40 | ```bash 41 | npm install --save @easyops-cn/docusaurus-search-local 42 | ``` 43 | 44 | 配置 docusaurus.config.js 45 | 46 | ```ts showLineNumbers 47 | // In your `docusaurus.config.js`: 48 | module.exports = { 49 | // ... Your other configurations. 50 | themes: [ 51 | // ... Your other themes. 52 | [ 53 | require.resolve("@easyops-cn/docusaurus-search-local"), 54 | { 55 | // ... Your options. 56 | // `hashed` is recommended as long-term-cache of index file is possible. 57 | hashed: true, 58 | // For Docs using Chinese, The `language` is recommended to set to: 59 | // ``` 60 | language: ["en", "zh"], 61 | // ``` 62 | }, 63 | ], 64 | ], 65 | }; 66 | ``` 67 | 68 | 详细配置说明: https://github.com/easyops-cn/docusaurus-search-local 69 | 70 | ## 国际化 71 | 72 | ### 配置 docusaurus.config.js 73 | 74 | ```ts showLineNumbers 75 | module.exports = { 76 | i18n: { 77 | defaultLocale: 'en', 78 | locales: ['en', 'zh-CN'], 79 | }, 80 | 81 | themeConfig: { 82 | navbar: { 83 | // 配置语言切换组件 84 | items: [ 85 | { 86 | type: 'localeDropdown', 87 | position: 'right', 88 | }, 89 | ], 90 | }, 91 | }, 92 | }; 93 | ``` 94 | 95 | ### 开发调试指定语言站点: 96 | 97 | ```bash 98 | # 调试中文站点 99 | npm run start -- --locale zh-CN 100 | ``` 101 | 102 | ### 翻译 103 | 104 | #### 翻译 Markdown 文件: 105 | 106 | ##### 翻译文档 107 | 108 | 将文档 Markdown 文件从 docs/ 复制到 i18n/zh-CN/docusaurus-plugin-content-docs/current,并翻译它们: 109 | 110 | ```bash 111 | mkdir -p i18n/zh-CN/docusaurus-plugin-content-docs/current 112 | cp -r docs/** i18n/zh-CN/docusaurus-plugin-content-docs/current 113 | ``` 114 | 115 | ##### 翻译博客 116 | 117 | 将文档 Markdown 文件从 docs/ 复制到 i18n/zh-CN/docusaurus-plugin-content-blog,并翻译它们: 118 | 119 | ```bash 120 | mkdir -p i18n/zh-CN/docusaurus-plugin-content-blog 121 | cp -r blog/** i18n/zh-CN/docusaurus-plugin-content-blog 122 | ``` 123 | 124 | ##### 翻译页面 125 | 126 | 将文档页面文件从 docs/ 复制到 i18n/zh-CN/docusaurus-plugin-content-pages,并翻译它们: 127 | 128 | ```bash 129 | mkdir -p i18n/zh-CN/docusaurus-plugin-content-pages 130 | cp -r src/pages/**.md i18n/zh-CN/docusaurus-plugin-content-pages 131 | cp -r src/pages/**.mdx i18n/zh-CN/docusaurus-plugin-content-pages 132 | ``` 133 | 134 | ##### 翻译内置组件文案 135 | 136 | 下列命令会自动翻译内置组件文案到 `i18n/zh-CN` 目录中 137 | 138 | ```bash 139 | npm run write-translations -- --locale zh-CN 140 | ``` 141 | 142 | ### 构建站点 143 | 144 | #### 单域名部署 145 | 146 | 构建站点还是用的加入国际化之前一样的命令 147 | 148 | ```bash 149 | npm run build 150 | ``` 151 | 152 | Docusaurus 将为每个语言版本构建一个单页面应用程序: 153 | 154 | - website/build:默认使用的英文语言 155 | - website/build/zh-cn:简体中文语言 156 | 157 | ### 踩坑记录 158 | 159 | 如果遇到类似下面的报错, 运行 `npm run write-translations -- --locale zh-CN`, 修改 `i18n/zh-CN` 中的文案, 删除前面这段 `One min read|` 160 | 161 | ```bash 162 | For locale=zh-CN, a maximum of 1 plural forms are expected (other), but the message contains 2: One min read|1 min read 163 | ``` 164 | 165 | 详细说明: https://docusaurus.io/zh-CN/docs/i18n/tutorial#single-domain-deployment 166 | 167 | ## 页面部署 168 | 169 | ### 国外 170 | 171 | 直接用 `github` 部署页面 172 | 173 | 页面地址: [https://zainchen.github.io/zaindoc](https://zainchen.github.io/zaindoc) 174 | 项目地址: [https://github.com/ZainChen/zaindoc](https://github.com/ZainChen/zaindoc) 175 | 176 | ### 国内 177 | 178 | 使用 `gitee` 部署页面 179 | 180 | 页面地址: [https://zainczy.gitee.io/zaindoc](https://zainczy.gitee.io/zaindoc) 181 | 项目地址: [https://gitee.com/zainczy/zaindoc](https://gitee.com/zainczy/zaindoc) 182 | 183 | ## 参考资料 184 | 185 | - 官方文档(多语言): https://docusaurus.io 186 | - 触发 GitHub Actions 自动部署: https://docusaurus.io/zh-CN/docs/deployment#triggering-deployment-with-github-actions 187 | - 本地搜索: https://github.com/easyops-cn/docusaurus-search-local 188 | - 国际化: https://docusaurus.io/zh-CN/docs/i18n/tutorial#single-domain-deployment 189 | -------------------------------------------------------------------------------- /docs/note/zaindoc/developer-guide.md: -------------------------------------------------------------------------------- 1 | # Developer guide 2 | 3 | ## Development/Build/Deployment 4 | 5 | ```bash 6 | # Install dependencies 7 | npm i 8 | 9 | # Development 10 | npm run start 11 | 12 | # Build 13 | npm run build 14 | 15 | # Deployment 16 | # If GitHub ssh is set up, you can use this command to automatically build and push it to the gh-pages branch of GitHub to trigger page updates 17 | USE_SSH=true npm run deploy 18 | ``` 19 | 20 | ### Automated Deployment Configuration 21 | 22 | Add the following two files in the root directory of the project's main branch: 23 | 24 | ```bash 25 | # Configuration for triggering build automatically when main branch is pushed to GitHub 26 | .github/workflows/deploy.yml 27 | 28 | # Configuration for triggering build automatically when main branch is pulled 29 | .github/workflows/test-deploy.yml 30 | ``` 31 | 32 | Detailed Description: https://docusaurus.io/docs/deployment#triggering-deployment-with-github-actions 33 | 34 | ## Search 35 | 36 | ### Local Search 37 | 38 | Install dependencies package 39 | 40 | ```bash 41 | npm install --save @easyops-cn/docusaurus-search-local 42 | ``` 43 | 44 | Configure docusaurus.config.js 45 | 46 | ```ts showLineNumbers 47 | // In your `docusaurus.config.js`: 48 | module.exports = { 49 | // ... Your other configurations. 50 | themes: [ 51 | // ... Your other themes. 52 | [ 53 | require.resolve("@easyops-cn/docusaurus-search-local"), 54 | { 55 | // ... Your options. 56 | // `hashed` is recommended as long-term-cache of index file is possible. 57 | hashed: true, 58 | // For Docs using Chinese, The `language` is recommended to set to: 59 | // ``` 60 | language: ["en", "zh"], 61 | // ``` 62 | }, 63 | ], 64 | ], 65 | }; 66 | ``` 67 | 68 | Detailed Configuration Instructions: https://github.com/easyops-cn/docusaurus-search-local 69 | 70 | ## Internationalization 71 | 72 | ### Configure docusaurus.config.js 73 | 74 | ```ts showLineNumbers 75 | module.exports = { 76 | i18n: { 77 | defaultLocale: 'en', 78 | locales: ['en', 'zh-CN'], 79 | }, 80 | 81 | themeConfig: { 82 | navbar: { 83 | // Configure language switching component 84 | items: [ 85 | { 86 | type: 'localeDropdown', 87 | position: 'right', 88 | }, 89 | ], 90 | }, 91 | }, 92 | }; 93 | ``` 94 | 95 | ### Develop and Debug Specified Language Site: 96 | 97 | ```bash 98 | # Debug the Chinese site 99 | npm run start -- --locale zh-CN 100 | ``` 101 | 102 | ### Translation 103 | 104 | #### Translate Markdown Files: 105 | 106 | ##### Translate Documents 107 | 108 | Copy the Markdown files from docs/ to i18n/zh-CN/docusaurus-plugin-content-docs/current and translate them as follows: 109 | 110 | ```bash 111 | mkdir -p i18n/zh-CN/docusaurus-plugin-content-docs/current 112 | cp -r docs/** i18n/zh-CN/docusaurus-plugin-content-docs/current 113 | ``` 114 | 115 | ##### Translate Blogs 116 | 117 | Copy the Markdown files from docs/ to i18n/zh-CN/docusaurus-plugin-content-blog and translate them as follows: 118 | 119 | ```bash 120 | mkdir -p i18n/zh-CN/docusaurus-plugin-content-blog 121 | cp -r blog/** i18n/zh-CN/docusaurus-plugin-content-blog 122 | ``` 123 | 124 | ##### Translate Pages 125 | 126 | Copy the document page files from docs/ to i18n/zh-CN/docusaurus-plugin-content-pages and translate them as follows: 127 | 128 | ```bash 129 | mkdir -p i18n/zh-CN/docusaurus-plugin-content-pages 130 | cp -r src/pages/**.md i18n/zh-CN/docusaurus-plugin-content-pages 131 | cp -r src/pages/**.mdx i18n/zh-CN/docusaurus-plugin-content-pages 132 | ``` 133 | 134 | ##### Translate Built-in Component Copy 135 | 136 | The following command automatically translates the built-in component copy to the `i18n/zh-CN` directory: 137 | 138 | ```bash 139 | npm run write-translations -- --locale zh-CN 140 | ``` 141 | 142 | ### Build Site 143 | 144 | #### Single-Domain Deployment 145 | 146 | The site is built using the same command as before internationalization was added. 147 | 148 | ```bash 149 | npm run build 150 | ``` 151 | 152 | Docusaurus will build a single-page application for each language version: 153 | 154 | - website/build: Default language is English 155 | - website/build/zh-cn: Simplified Chinese language 156 | 157 | ### Pitfalls 158 | 159 | If you encounter an error similar to the following, run `npm run write-translations -- --locale zh-CN`, modify the copy in `i18n/zh-CN`, and delete the `One min read|` prefix: 160 | 161 | ```bash 162 | For locale=zh-CN, a maximum of 1 plural forms are expected (other), but the message contains 2: One min read|1 min read 163 | ``` 164 | 165 | Detailed Instructions: https://docusaurus.io/docs/i18n/tutorial#single-domain-deployment 166 | 167 | ## Page Deployment 168 | 169 | ### Overseas 170 | 171 | Directly use `GitHub` to deploy the page 172 | 173 | Page URL: [https://zainchen.github.io/zaindoc](https://zainchen.github.io/zaindoc) 174 | Project URL: [https://github.com/ZainChen/zaindoc](https://github.com/ZainChen/zaindoc) 175 | 176 | ### Domestic 177 | 178 | Use `Gitee` to deploy the page 179 | 180 | Page URL: [https://zainczy.gitee.io/zaindoc](https://zainczy.gitee.io/zaindoc) 181 | Project URL: [https://gitee.com/zainczy/zaindoc](https://gitee.com/zainczy/zaindoc) 182 | 183 | ## References 184 | 185 | - Official Documentation (Multilingual): https://docusaurus.io 186 | - Triggering GitHub Actions Automatic Deployment: https://docusaurus.io/docs/deployment#triggering-deployment-with-github-actions 187 | - Local Search: https://github.com/easyops-cn/docusaurus-search-local 188 | - Internationalization: https://docusaurus.io/docs/i18n/tutorial#single-domain-deployment 189 | -------------------------------------------------------------------------------- /docusaurus.config.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Note: type annotations allow type checking and IDEs autocompletion 3 | 4 | const lightCodeTheme = require('prism-react-renderer/themes/github') 5 | const darkCodeTheme = require('prism-react-renderer/themes/dracula') 6 | 7 | /** @type {import('@docusaurus/types').Config} */ 8 | const config = { 9 | title: 'Zaindoc', 10 | tagline: 'Dinosaurs are cool', 11 | url: 'https://zainchen.github.io', 12 | baseUrl: '/zaindoc/', 13 | onBrokenLinks: 'throw', 14 | onBrokenMarkdownLinks: 'warn', 15 | favicon: 'img/favicon.ico', 16 | organizationName: 'ZainChen', // Usually your GitHub org/user name. 17 | projectName: 'zaindoc', // Usually your repo name. 18 | trailingSlash: false, 19 | 20 | i18n: { 21 | defaultLocale: 'en', 22 | locales: ['en', 'zh-CN'], 23 | }, 24 | 25 | presets: [ 26 | [ 27 | 'classic', 28 | /** @type {import('@docusaurus/preset-classic').Options} */ 29 | ({ 30 | docs: { 31 | sidebarPath: require.resolve('./sidebars.js'), 32 | // Please change this to your repo. 33 | editUrl: 'https://github.com/ZainChen/zaindoc/tree/main', 34 | editLocalizedFiles: true, 35 | }, 36 | blog: { 37 | showReadingTime: true, 38 | // Please change this to your repo. 39 | editUrl: 'https://github.com/ZainChen/zaindoc/tree/main', 40 | editLocalizedFiles: true, 41 | }, 42 | theme: { 43 | customCss: require.resolve('./src/css/custom.css'), 44 | }, 45 | gtag: { 46 | trackingID: 'G-M0KMJZZJ5P', 47 | anonymizeIP: true, 48 | }, 49 | }), 50 | ], 51 | ], 52 | 53 | themes: [ 54 | // ... Your other themes. 55 | [ 56 | require.resolve('@easyops-cn/docusaurus-search-local'), 57 | { 58 | // ... Your options. 59 | // `hashed` is recommended as long-term-cache of index file is possible. 60 | hashed: true, 61 | // For Docs using Chinese, The `language` is recommended to set to: 62 | // ``` 63 | language: ['en', 'zh'], 64 | // ``` 65 | }, 66 | ], 67 | ], 68 | 69 | themeConfig: 70 | /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ 71 | ({ 72 | // Replace with your project's social card 73 | image: 'img/docusaurus-social-card.jpg', 74 | docs: { 75 | sidebar: { 76 | hideable: true, 77 | }, 78 | }, 79 | navbar: { 80 | title: 'Zaindoc', 81 | logo: { 82 | alt: 'Zain Logo', 83 | src: 'img/logo.jpeg', 84 | }, 85 | items: [ 86 | { 87 | type: 'docSidebar', 88 | position: 'left', 89 | sidebarId: 'sidebarIdNote', 90 | label: 'Note', 91 | }, 92 | { 93 | type: 'doc', 94 | docId: 'doc/intro', 95 | position: 'left', 96 | label: 'Doc', 97 | }, 98 | { to: '/blog', label: 'Blog', position: 'left' }, 99 | { to: '/zain', label: 'Zain', position: 'left' }, 100 | { 101 | type: 'localeDropdown', 102 | position: 'right', 103 | }, 104 | { 105 | href: 'https://github.com/ZainChen/zaindoc', 106 | label: 'GitHub', 107 | position: 'right', 108 | }, 109 | ], 110 | }, 111 | footer: { 112 | style: 'dark', 113 | links: [ 114 | { 115 | title: 'Docs', 116 | items: [ 117 | { 118 | label: 'Tutorial', 119 | to: '/docs/doc/intro', 120 | }, 121 | ], 122 | }, 123 | { 124 | title: 'Community', 125 | items: [ 126 | { 127 | label: 'Stack Overflow', 128 | href: 'https://stackoverflow.com/questions/tagged/docusaurus', 129 | }, 130 | { 131 | label: 'Discord', 132 | href: 'https://discordapp.com/invite/docusaurus', 133 | }, 134 | { 135 | label: 'Twitter', 136 | href: 'https://twitter.com/docusaurus', 137 | }, 138 | ], 139 | }, 140 | { 141 | title: 'More', 142 | items: [ 143 | { 144 | label: 'Blog', 145 | to: '/blog', 146 | }, 147 | { 148 | label: 'GitHub', 149 | href: 'https://github.com/facebook/docusaurus', 150 | }, 151 | ], 152 | }, 153 | ], 154 | copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`, 155 | }, 156 | prism: { 157 | theme: lightCodeTheme, 158 | darkTheme: darkCodeTheme, 159 | }, 160 | }), 161 | 162 | plugins: [ 163 | // async function pluginAlias(context, options) { 164 | // return { 165 | // name: 'zain-alias-plugin', 166 | // configureWebpack() { 167 | // return { 168 | // resolve: { 169 | // alias: { 170 | // // 模块导入别名,指定后可以在文件之直接 import * from 'src/*'; 171 | // // 在 tsconfig.json 中添加 "paths": {"src/*": ["./src/*"]} 172 | // src: path.resolve(__dirname, './src/'), 173 | // }, 174 | // }, 175 | // }; 176 | // }, 177 | // }; 178 | // }, 179 | // 插件可以直接像上面一样直接写在当前文件, 也可以独立文件编写 180 | ['./plugin/alias.js', {}], 181 | ], 182 | } 183 | 184 | module.exports = config 185 | -------------------------------------------------------------------------------- /static/img/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/note/other/markdown-guide.md: -------------------------------------------------------------------------------- 1 | # Markdown User Guide 2 | 3 | --- 4 | 5 | ## Title 6 | 7 | > Standard syntax typically involves writing text after a `#` followed by a space 8 | 9 | ```markdown 10 | # This is a level-one heading 11 | ## This is a level-two heading 12 | ### This is a level-three heading 13 | #### This is a level-four heading 14 | ##### This is a level-five heading 15 | ###### This is a level-six heading 16 | ``` 17 | 18 | Example: 19 | 20 | # This is a level-one heading 21 | ## This is a level-two heading 22 | ### This is a level-three heading 23 | #### This is a level-four heading 24 | ##### This is a level-five heading 25 | ###### This is a level-six heading 26 | 27 | --- 28 | 29 | ## Font 30 | 31 | ```markdown 32 | **This is bold text** 33 | *This is italicized text* 34 | ***This is bold and italicized text*** 35 | ~~This is strikethrough text~~ 36 | ``` 37 | 38 | Example: 39 | 40 | **This is bold text** 41 | 42 | *This is italicized text* 43 | 44 | ***This is bold and italicized text*** 45 | 46 | ~~This is strikethrough text~~ 47 | 48 | --- 49 | 50 | ## Quote 51 | 52 | > Simply add the symbol `>` before the text you want to quote. The quotation can be nested, such as adding two `>>`, three `>>>`, n number of... 53 | 54 | ```markdown 55 | >This is the quotation 56 | >>This is the quoted content 57 | >> 58 | >>>>>>>>>>This is the citation 59 | ``` 60 | 61 | Example: 62 | 63 | >This is the quotation 64 | >>This is the quoted content 65 | >> 66 | >>>>>>>>>>This is the citation 67 | 68 | --- 69 | 70 | ## Divider 71 | 72 | > Three or more `-` or `*` will do 73 | 74 | ```markdown 75 | ---- 76 | *** 77 | ***** 78 | ``` 79 | 80 | Example: 81 | 82 | ---- 83 | *** 84 | ***** 85 | 86 | ## Image 87 | 88 | ### Method 1 89 | 90 | > Can't change image size 91 | 92 | Image alt: the text displayed below the image, an explanation of the image content (can be added or not, Typora is not valid) 93 | 94 | Image title: the title of the image, the content displayed when the mouse moves over the image (can be added or not, Typora is not valid) 95 | 96 | ```markdown 97 | ![image alt](image address "image title") 98 | ``` 99 | 100 | Example: 101 | 102 | ![zain](https://zainchen.github.io/zaindoc/zh-CN/img/logo.jpeg "zain") 103 | 104 | ### Method 2 105 | 106 | > Directly using the `html` tag, you can modify the image size 107 | 108 | ```html 109 | 志银 110 | ``` 111 | 112 | 志银 113 | 114 | --- 115 | 116 | ## Hyperlink 117 | 118 | ### Method 1 119 | 120 | > `title` can be added or not 121 | 122 | ```markdown 123 | [Hyperlink name](Hyperlink address "Hyperlink title") 124 | ``` 125 | 126 | Example: 127 | 128 | [Google](https://www.google.com) 129 | [Bing](https://www.bing.com) 130 | 131 | ### Method 2 132 | 133 | ```html 134 | Hyperlink title 135 | ``` 136 | 137 | Example: 138 | Google 139 | 140 | --- 141 | 142 | ## List 143 | 144 | ### Unordered list 145 | 146 | > `-` `+` `*` Either one is fine (a space between `-` `+` `*` and the content) 147 | 148 | ```markdown 149 | - List content 150 | + list content 151 | * list content 152 | ``` 153 | 154 | Example: 155 | 156 | - List content 157 | + list content 158 | * List Contents 159 | 160 | ### Ordered list 161 | 162 | > Add a space between the number and the content 163 | 164 | ```markdown 165 | 1. list content 166 | 2. list content 167 | 3. list content 168 | ``` 169 | 170 | Example: 171 | 172 | 1. list content 173 | 2. list content 174 | 3. list content 175 | 176 | ### List nesting 177 | 178 | > Just knock two spaces between the previous and next level 179 | 180 | ```markdown 181 | - List Contents 182 | - List Contents 183 | - List Contents 184 | - List Contents 185 | - List Contents 186 | + List Contents 187 | * List Contents 188 | ``` 189 | 190 | Example: 191 | 192 | - List Contents 193 | - List Contents 194 | - List Contents 195 | - List Contents 196 | - List Contents 197 | + List Contents 198 | * List Contents 199 | 200 | --- 201 | 202 | ## Table 203 | 204 | Note: 205 | 206 | The second line separates the header and content (only need one `-` for alignment, but extra ones are added for clarity). 207 | 208 | Text aligns to the left by default. 209 | 210 | Header separator `-` with `:` on both sides aligns header text to the center. 211 | 212 | Header separator `-` with `:` on the right aligns header text to the right. 213 | 214 | Header separator `-` with `:` on the left aligns header text to the left. 215 | 216 | (Note: In the original syntax, both sides of the table to be enclosed in `| `, but it is omitted here.) 217 | 218 | ```markdown 219 | Header|Header|Header 220 | ---|:--:|--: 221 | Content|Content|Content 222 | Content|Content|Content 223 | ``` 224 | 225 | Example: 226 | 227 | Header|Header|Header 228 | ---|:--:|--: 229 | Content|Content|Content 230 | Content|Content|Content 231 | 232 | --- 233 | 234 | ## Code 235 | 236 | ### Inline Code 237 | 238 | > Use one backtick to surround the code 239 | 240 | ```markdown 241 | `Code Content` 242 | ``` 243 | 244 | Example: 245 | 246 | `Code Content` 247 | 248 | ### Code Blocks 249 | 250 | > Code blocks are enclosed in three backticks on each side, and the backticks occupy a separate line. 251 | 252 | ```markdown 253 | // Use `\` as a placeholder to prevent syntax from taking effect. 254 | \```cpp 255 | Code block... 256 | Code block... 257 | Code block... 258 | \``` 259 | ``` 260 | 261 | Example: 262 | 263 | ```cpp 264 | /* 265 | Binary string to decimal 266 | Header: 267 | #include 268 | using namespace std; 269 | Parameter: 270 | string s: binary string to be converted 271 | Return: 272 | long long : decimal number after conversion 273 | Example: 274 | cout << BinaryToInt("000010101"); //21 275 | */ 276 | long long BinaryToInt(string s) { 277 | long long sum = 0; 278 | int k = 0; 279 | for(int i = s.size()-1; i >= 0; i--) { 280 | long long q = 1; 281 | for(int j = 1; j <= k; j++) { 282 | q *= 2; 283 | } 284 | sum += (s[i]-48)*q; 285 | k++; 286 | } 287 | return sum; 288 | } 289 | ``` 290 | -------------------------------------------------------------------------------- /static/img/undraw_docusaurus_tree.svg: -------------------------------------------------------------------------------- 1 | 2 | Focus on What Matters 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /i18n/zh-CN/code.json: -------------------------------------------------------------------------------- 1 | { 2 | "theme.ErrorPageContent.title": { 3 | "message": "页面已崩溃。", 4 | "description": "The title of the fallback page when the page crashed" 5 | }, 6 | "theme.ErrorPageContent.tryAgain": { 7 | "message": "重试", 8 | "description": "The label of the button to try again when the page crashed" 9 | }, 10 | "theme.NotFound.title": { 11 | "message": "找不到页面", 12 | "description": "The title of the 404 page" 13 | }, 14 | "theme.NotFound.p1": { 15 | "message": "我们找不到您要找的页面。", 16 | "description": "The first paragraph of the 404 page" 17 | }, 18 | "theme.NotFound.p2": { 19 | "message": "请联系原始链接来源网站的所有者,并告知他们链接已损坏。", 20 | "description": "The 2nd paragraph of the 404 page" 21 | }, 22 | "theme.admonition.note": { 23 | "message": "备注", 24 | "description": "The default label used for the Note admonition (:::note)" 25 | }, 26 | "theme.admonition.tip": { 27 | "message": "提示", 28 | "description": "The default label used for the Tip admonition (:::tip)" 29 | }, 30 | "theme.admonition.danger": { 31 | "message": "危险", 32 | "description": "The default label used for the Danger admonition (:::danger)" 33 | }, 34 | "theme.admonition.info": { 35 | "message": "信息", 36 | "description": "The default label used for the Info admonition (:::info)" 37 | }, 38 | "theme.admonition.caution": { 39 | "message": "警告", 40 | "description": "The default label used for the Caution admonition (:::caution)" 41 | }, 42 | "theme.BackToTopButton.buttonAriaLabel": { 43 | "message": "回到顶部", 44 | "description": "The ARIA label for the back to top button" 45 | }, 46 | "theme.blog.archive.title": { 47 | "message": "历史博文", 48 | "description": "The page & hero title of the blog archive page" 49 | }, 50 | "theme.blog.archive.description": { 51 | "message": "历史博文", 52 | "description": "The page & hero description of the blog archive page" 53 | }, 54 | "theme.blog.paginator.navAriaLabel": { 55 | "message": "博文列表分页导航", 56 | "description": "The ARIA label for the blog pagination" 57 | }, 58 | "theme.blog.paginator.newerEntries": { 59 | "message": "较新的博文", 60 | "description": "The label used to navigate to the newer blog posts page (previous page)" 61 | }, 62 | "theme.blog.paginator.olderEntries": { 63 | "message": "较旧的博文", 64 | "description": "The label used to navigate to the older blog posts page (next page)" 65 | }, 66 | "theme.blog.post.paginator.navAriaLabel": { 67 | "message": "博文分页导航", 68 | "description": "The ARIA label for the blog posts pagination" 69 | }, 70 | "theme.blog.post.paginator.newerPost": { 71 | "message": "较新一篇", 72 | "description": "The blog post button label to navigate to the newer/previous post" 73 | }, 74 | "theme.blog.post.paginator.olderPost": { 75 | "message": "较旧一篇", 76 | "description": "The blog post button label to navigate to the older/next post" 77 | }, 78 | "theme.blog.post.plurals": { 79 | "message": "{count} 篇博文", 80 | "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" 81 | }, 82 | "theme.blog.tagTitle": { 83 | "message": "{nPosts} 含有标签「{tagName}」", 84 | "description": "The title of the page for a blog tag" 85 | }, 86 | "theme.tags.tagsPageLink": { 87 | "message": "查看所有标签", 88 | "description": "The label of the link targeting the tag list page" 89 | }, 90 | "theme.colorToggle.ariaLabel": { 91 | "message": "切换浅色/暗黑模式(当前为{mode})", 92 | "description": "The ARIA label for the navbar color mode toggle" 93 | }, 94 | "theme.colorToggle.ariaLabel.mode.dark": { 95 | "message": "暗黑模式", 96 | "description": "The name for the dark color mode" 97 | }, 98 | "theme.colorToggle.ariaLabel.mode.light": { 99 | "message": "浅色模式", 100 | "description": "The name for the light color mode" 101 | }, 102 | "theme.docs.breadcrumbs.navAriaLabel": { 103 | "message": "页面路径", 104 | "description": "The ARIA label for the breadcrumbs" 105 | }, 106 | "theme.docs.DocCard.categoryDescription": { 107 | "message": "{count} 个项目", 108 | "description": "The default description for a category card in the generated index about how many items this category includes" 109 | }, 110 | "theme.docs.paginator.navAriaLabel": { 111 | "message": "文档分页导航", 112 | "description": "The ARIA label for the docs pagination" 113 | }, 114 | "theme.docs.paginator.previous": { 115 | "message": "上一页", 116 | "description": "The label used to navigate to the previous doc" 117 | }, 118 | "theme.docs.paginator.next": { 119 | "message": "下一页", 120 | "description": "The label used to navigate to the next doc" 121 | }, 122 | "theme.docs.tagDocListPageTitle.nDocsTagged": { 123 | "message": "{count} 篇文档带有标签", 124 | "description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" 125 | }, 126 | "theme.docs.tagDocListPageTitle": { 127 | "message": "{nDocsTagged}「{tagName}」", 128 | "description": "The title of the page for a docs tag" 129 | }, 130 | "theme.common.editThisPage": { 131 | "message": "编辑此页", 132 | "description": "The link label to edit the current page" 133 | }, 134 | "theme.docs.versionBadge.label": { 135 | "message": "版本:{versionLabel}" 136 | }, 137 | "theme.docs.versions.unreleasedVersionLabel": { 138 | "message": "此为 {siteTitle} {versionLabel} 版尚未发行的文档。", 139 | "description": "The label used to tell the user that he's browsing an unreleased doc version" 140 | }, 141 | "theme.docs.versions.unmaintainedVersionLabel": { 142 | "message": "此为 {siteTitle} {versionLabel} 版的文档,现已不再积极维护。", 143 | "description": "The label used to tell the user that he's browsing an unmaintained doc version" 144 | }, 145 | "theme.docs.versions.latestVersionSuggestionLabel": { 146 | "message": "最新的文档请参阅 {latestVersionLink} ({versionLabel})。", 147 | "description": "The label used to tell the user to check the latest version" 148 | }, 149 | "theme.docs.versions.latestVersionLinkLabel": { 150 | "message": "最新版本", 151 | "description": "The label used for the latest version suggestion link label" 152 | }, 153 | "theme.lastUpdated.atDate": { 154 | "message": "于 {date} ", 155 | "description": "The words used to describe on which date a page has been last updated" 156 | }, 157 | "theme.lastUpdated.byUser": { 158 | "message": "由 {user} ", 159 | "description": "The words used to describe by who the page has been last updated" 160 | }, 161 | "theme.lastUpdated.lastUpdatedAtBy": { 162 | "message": "最后{byUser}{atDate}更新", 163 | "description": "The sentence used to display when a page has been last updated, and by who" 164 | }, 165 | "theme.common.headingLinkTitle": { 166 | "message": "{heading}的直接链接", 167 | "description": "Title for link to heading" 168 | }, 169 | "theme.navbar.mobileVersionsDropdown.label": { 170 | "message": "选择版本", 171 | "description": "The label for the navbar versions dropdown on mobile view" 172 | }, 173 | "theme.tags.tagsListLabel": { 174 | "message": "标签:", 175 | "description": "The label alongside a tag list" 176 | }, 177 | "theme.AnnouncementBar.closeButtonAriaLabel": { 178 | "message": "关闭", 179 | "description": "The ARIA label for close button of announcement bar" 180 | }, 181 | "theme.blog.sidebar.navAriaLabel": { 182 | "message": "最近博文导航", 183 | "description": "The ARIA label for recent posts in the blog sidebar" 184 | }, 185 | "theme.CodeBlock.copied": { 186 | "message": "复制成功", 187 | "description": "The copied button label on code blocks" 188 | }, 189 | "theme.CodeBlock.copyButtonAriaLabel": { 190 | "message": "复制代码到剪贴板", 191 | "description": "The ARIA label for copy code blocks button" 192 | }, 193 | "theme.CodeBlock.copy": { 194 | "message": "复制", 195 | "description": "The copy button label on code blocks" 196 | }, 197 | "theme.CodeBlock.wordWrapToggle": { 198 | "message": "切换自动换行", 199 | "description": "The title attribute for toggle word wrapping button of code block lines" 200 | }, 201 | "theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": { 202 | "message": "打开/收起侧边栏菜单「{label}」", 203 | "description": "The ARIA label to toggle the collapsible sidebar category" 204 | }, 205 | "theme.NavBar.navAriaLabel": { 206 | "message": "主导航", 207 | "description": "The ARIA label for the main navigation" 208 | }, 209 | "theme.blog.post.readMore": { 210 | "message": "阅读更多", 211 | "description": "The label used in blog post item excerpts to link to full blog posts" 212 | }, 213 | "theme.blog.post.readMoreLabel": { 214 | "message": "阅读 {title} 的全文", 215 | "description": "The ARIA label for the link to full blog posts from excerpts" 216 | }, 217 | "theme.navbar.mobileLanguageDropdown.label": { 218 | "message": "选择语言", 219 | "description": "The label for the mobile language switcher dropdown" 220 | }, 221 | "theme.blog.post.readingTime.plurals": { 222 | "message": "阅读需 {readingTime} 分钟", 223 | "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" 224 | }, 225 | "theme.TOCCollapsible.toggleButtonLabel": { 226 | "message": "本页总览", 227 | "description": "The label used by the button on the collapsible TOC component" 228 | }, 229 | "theme.docs.breadcrumbs.home": { 230 | "message": "主页面", 231 | "description": "The ARIA label for the home page in the breadcrumbs" 232 | }, 233 | "theme.docs.sidebar.collapseButtonTitle": { 234 | "message": "收起侧边栏", 235 | "description": "The title attribute for collapse button of doc sidebar" 236 | }, 237 | "theme.docs.sidebar.collapseButtonAriaLabel": { 238 | "message": "收起侧边栏", 239 | "description": "The title attribute for collapse button of doc sidebar" 240 | }, 241 | "theme.docs.sidebar.closeSidebarButtonAriaLabel": { 242 | "message": "关闭导航栏", 243 | "description": "The ARIA label for close button of mobile sidebar" 244 | }, 245 | "theme.docs.sidebar.navAriaLabel": { 246 | "message": "文档侧边栏", 247 | "description": "The ARIA label for the sidebar navigation" 248 | }, 249 | "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { 250 | "message": "← 回到主菜单", 251 | "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" 252 | }, 253 | "theme.docs.sidebar.toggleSidebarButtonAriaLabel": { 254 | "message": "切换导航栏", 255 | "description": "The ARIA label for hamburger menu button of mobile navigation" 256 | }, 257 | "theme.docs.sidebar.expandButtonTitle": { 258 | "message": "展开侧边栏", 259 | "description": "The ARIA label and title attribute for expand button of doc sidebar" 260 | }, 261 | "theme.docs.sidebar.expandButtonAriaLabel": { 262 | "message": "展开侧边栏", 263 | "description": "The ARIA label and title attribute for expand button of doc sidebar" 264 | }, 265 | "theme.SearchPage.existingResultsTitle": { 266 | "message": "“{query}” 的搜索结果", 267 | "description": "The search page title for non-empty query" 268 | }, 269 | "theme.SearchPage.emptyResultsTitle": { 270 | "message": "搜索文档", 271 | "description": "The search page title for empty query" 272 | }, 273 | "theme.SearchPage.documentsFound.plurals": { 274 | "message": "共找到 {count} 篇文档", 275 | "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" 276 | }, 277 | "theme.SearchPage.noResultsText": { 278 | "message": "没有找到任何文档", 279 | "description": "The paragraph for empty search result" 280 | }, 281 | "theme.SearchBar.noResultsText": { 282 | "message": "没有找到任何文档" 283 | }, 284 | "theme.SearchBar.seeAll": { 285 | "message": "查看全部结果" 286 | }, 287 | "theme.SearchBar.label": { 288 | "message": "搜索", 289 | "description": "The ARIA label and placeholder for search button" 290 | }, 291 | "theme.common.skipToMainContent": { 292 | "message": "跳到主要内容", 293 | "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" 294 | }, 295 | "theme.tags.tagsPageTitle": { 296 | "message": "标签", 297 | "description": "The title of the tag list page" 298 | } 299 | } 300 | -------------------------------------------------------------------------------- /static/img/undraw_docusaurus_mountain.svg: -------------------------------------------------------------------------------- 1 | 2 | Easy to Use 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /static/img/undraw_docusaurus_react.svg: -------------------------------------------------------------------------------- 1 | 2 | Powered by React 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | --------------------------------------------------------------------------------