Skip to content

[Enhancement]Document rebuild with Vuepress. #3408

@hffariel

Description

@hffariel

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:

image

Implementation

  1. 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.
  1. 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:

    ![alter text](/images/image_x.png)
    • 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.md

    Then 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"
    ]
    
  2. 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.

Metadata

Metadata

Assignees

Labels

kind/docsCategorizes issue or PR as related to documentation.kind/improvement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions