-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Motivation
As we see, our documents' website now has some disadvantages like: old fashioned design, mobile incompatible, lack of version control, etc. So i'm trying to rebuild our website with Vuepress which is a minimalistic Vue-powered static site generator.
A whole new look
By doing this, we'll have some new features like: more friendly UI, better localization, new version management. And it'll be like:
Implementation
- Docs' directory will be with a new structure:
.
├─ docs/
│ ├─ .vuepress
│ │ ├─ dist // Built site files.
│ │ ├─ public // Assets
│ │ ├─ sidebar // Side bar configurations.
│ │ │ ├─ en.js
│ │ │ └─ zh-CN.js
│ ├─ theme // Global styles and customizations.
│ └─ config.js // Vuepress configurations.
├─ zh-CN/
│ ├─ xxxx.md
│ └─ README.md // Will be rendered as entry page.
└─ en/
├─ xxxx.md
└─ README.md // Will be rendered as entry page.-
New way of writing a document.
- Write in multi languages and put them in separated folders
./en/and./zh-CN/. But they should be with the same name.
. ├─ en/ │ ├─ one.md │ └─ two.md └─ zh-CN/ │ ├─ one.md │ └─ two.md- Frontmatters like below should always be on the top of each file:
--- { "title": "Backup and Recovery", // sidebar title "language": "en" // writing language } ---
- Assets are in
.vuepress/public/.
Assuming that there exists a png
.vuepress/public/images/image_x.png, then it can be used like:
- Sidebar configurations in
.vuepress/sidebar/need to be updated after adding a new file or a folder.
Assuming that the directories are:
. ├─ en/ │ ├─ subfolder │ │ ├─ one.md │ │ └─ two.md │ └─ three.md └─ zh-CN/ ├─ subfolder │ ├─ one.md │ └─ two.md └─ three.mdThen the sidebar configurations would be like:
// .vuepress/sidebar/en.js` module.exports = [ { title: "subfolder name", directoryPath: "subfolder/", children: ["one", "two"] }, "three" ]// .vuepress/sidebar/zh-CN.js module.exports = [ { title: "文件夹名称", directoryPath: "subfolder/", children: ["one", "two"] }, "three" ] - Write in multi languages and put them in separated folders
-
TravisCI will be integrated for auto building.
Once a PR accepted, TravisCI will be triggered to build all the document files within its own branch. Then push them to a separated directory in https://github.com/apache/incubator-doris-website.
