Apache StreamPark 网站项目使用教程
1. 项目的目录结构及介绍
Apache StreamPark 网站项目的目录结构如下:
|-- community
|-- docs
|-- src
| |-- pages
| |-- styles
|-- static
| |-- img
|-- docusaurus.config.js
|-- package.json
|-- pnpm-lock.yaml
|-- README.md
目录结构介绍
- community: 包含社区相关文档和资源。
- docs: 包含项目的文档文件。
- src: 包含网站的源代码。
- pages: 网站的页面文件。
- styles: 网站的样式文件。
- static: 静态资源文件夹。
- img: 图片资源。
- docusaurus.config.js: Docusaurus 配置文件。
- package.json: 项目的依赖管理文件。
- pnpm-lock.yaml: pnpm 的锁定文件。
- README.md: 项目说明文件。
2. 项目的启动文件介绍
项目的启动文件主要是 package.json
中的脚本命令。以下是一些关键的启动命令:
- pnpm install: 安装项目依赖。
- pnpm run start: 启动开发服务器,预览英文版本。
- pnpm run start-zh: 启动开发服务器,预览中文版本。
- pnpm run build: 构建静态网站资源文件。
启动文件介绍
- package.json:
{ "scripts": { "start": "docusaurus start", "build": "docusaurus build", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", "clear": "docusaurus clear", "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids", "start-zh": "docusaurus start --locale zh-Hans" } }
3. 项目的配置文件介绍
项目的配置文件主要是 docusaurus.config.js
,它包含了网站的各种配置信息。
配置文件介绍
- docusaurus.config.js:
module.exports = { title: 'Apache StreamPark', tagline: 'A magical framework that makes stream processing easier', url: 'https://streampark.apache.org', baseUrl: '/', onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'warn', favicon: 'img/favicon.ico', organizationName: 'apache', projectName: 'incubator-streampark-website', themeConfig: { navbar: { title: 'Apache StreamPark', logo: { alt: 'Apache StreamPark Logo', src: 'img/logo.svg', }, items: [ { to: 'docs/', activeBasePath: 'docs', label: 'Docs', position: 'left', }, {to: 'blog', label: 'Blog', position: 'left'}, { href: 'https://github.com/apache/incubator-streampark-website', label: 'GitHub', position: 'right', }, ], }, footer: { style: 'dark', links: [ { title: 'Docs', items: [ { label: 'Style Guide', to: 'docs/', }, ], }, { title: 'Community', items: [ { label: 'Stack Overflow', href: 'https://stackoverflow.com/questions/tagged/docusaurus', }, { label: 'Discord', href: 'https://discordapp.com/invite/docusaurus', }, { label: 'Twitter', href: 'https://twitter.com/docusaurus', },