Skip to content

Latest commit

 

History

History
106 lines (73 loc) · 2.3 KB

DOCS_README.md

File metadata and controls

106 lines (73 loc) · 2.3 KB

Documentation Build Workflow

The documentation is hosted in vuilder-docs and published to https://docs.vite.org/.

How It Works

A GitHub action is used for documentation deployment. New changes pushed to the master branch of the github repository will automatically be deployed

README.MD

README.MD is used as the landing page in each directory.

Config.js

The config.js generates the sidebar and table of contents. Auto sidebar is enabled, so there is no need to set up the sidebar separately.

Markdown configuration

Markdown files can contain optional YAML FrontMatter. Several properties are used:

---
# title is displayed in the sidebar
title: Title of the file
# order specifies file's priority in the sidebar
order: 2
# parent is readme.md or index.md parent directory
parent:
  title: Directory title
  order: 1
---

Setting order: false will remove the item (file or directory) from the sidebar. It is valid to use a readme.md to set an order of the parent directory and hide the file with order: false.

Links

Use relative path for links.

Such as:

[LINK](./README.md)

It works as follows:

LINK

Directory Structure with Images

If you have an image or an asset to link, put the asset nearly by the file, then link to it with relative path.

Such as:

- test.md
- test.png

If one doc directory contain many files and assets, put all assets into a folder named assets.

For example:

- test1.md
- test2.md
- test3.md
- test4.md
- test5.md
- assets
   - test1-01.png
   - test1-02.png
   - test1-03.png
   - test2-01.png
   - test2-02.png
   - test2-03.png
   - test3-01.png
   - test3-02.png
   - test3-03.png

Here is a real example: https://github.com/vitelabs/vite-docs/tree/master/articles

All images in articles directory are stored in articles/assets directory.

Running Locally

Run the following commands:

rm -rf node_modules

This command will remove old version of the visual theme and required packages. This step is optional.

yarn install

Install the theme and all dependencies.

yarn run dev

To build documentation as static website, run yarn run build. The built files are stored in .vuepress/dist directory.