Skip to content

Commit

Permalink
docs: use vuepress for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Jun 6, 2018
1 parent aa822f4 commit 057ffd4
Show file tree
Hide file tree
Showing 28 changed files with 385 additions and 696 deletions.
49 changes: 49 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
module.exports = {
title: 'UmiJS',
description: '极快的类 Next.js 的 React 应用框架。',
// locales: {
// '/': {
// lang: 'en-US',
// description: 'Blazing-fast next.js-like framework for React apps.',
// },
// '/zh/': {
// lang: 'zh-CN',
// description: '极快的类 Next.js 的 React 应用框架。',
// },
// },
themeConfig: {
lastUpdated: 'Last Updated',
editLinks: true,
editLinkText: '在 GitHub 上编辑此页',
nav: [
{ text: '指南', link: '/guide/' },
{ text: '配置', link: '/config/' },
{ text: 'API', link: '/api/' },
{ text: '发布日志', link: 'https://github.com/umijs/umi/releases' },
],
sidebar: {
'/guide/': [
{
title: '指南',
collapsable: false,
children: [
'',
'getting-started',
'app-structure',
'router',
'navigate-between-pages',
'config',
'add-404-page',
'html-template',
'load-on-demand',
'deploy',
'env-variables',
'faq',
],
},
],
'/config/': [''],
'/api/': [''],
},
},
};
4 changes: 4 additions & 0 deletions docs/.vuepress/override.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$accentColor = #DC7675
$textColor = #2c3e50
$borderColor = #EFD4E3
$codeBgColor = #282c34
30 changes: 30 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
home: true
actionText: 快速上手 →
actionLink: /guide/
features:
- title: 开箱即用
details: 你只需一个依赖 umi 就可启动开发,而无需安装 react、preact、react-router、eslint、babel、jest 等。
- title: 高性能
details: PWA、按需加载、tree-shake、scope-hoist、智能提取公共文件、Critical CSS、preload、hash build、preact 等等,并且,你相同的代码会随着 umi 的改进而不断提升性能。
- title: 扩展性
details: umi 的整个生命周期都是插件化的,甚至就是由大量插件组成,比如 http mock、service worker、layout、高清方案等,都是一个个的插件。
footer: MIT Licensed | Copyright © 2017-present
---

### 入门非常简单

```bash
# 安装
$ yarn global add umi # 或者:npm install -g umi

# 新建一个页面
$ mkdir pages
$ echo 'export default () => <h1>Hello umi</h1>;' > pages/index.js

# 启动调试服务器
$ umi dev

# 构建
$ umi build
```
23 changes: 10 additions & 13 deletions docs/api.md → docs/api/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
---
id: api
title: API
sidebarDepth: 2
---

## 索引
# API

* [umi/link](#umi-link)
* [umi/router](#umi-router)
* [umi/navlink](#umi-navlink)
* [umi/redirect](#umi-redirect)
* [umi/withRouter](#umi-withRouter)
* [umi/dynamic](#umi-dynamic)
* [umi/babel](#umi-babel)
## 路由


## API 列表
### umi/link
通过声明的方式做路由跳转。

Expand Down Expand Up @@ -81,6 +72,7 @@ router.go(2);
```

#### router.goBack()

后退一页。

例子:
Expand Down Expand Up @@ -111,7 +103,10 @@ import Redirect from 'umi/redirect';

详见:https://reacttraining.com/react-router/web/api/withRouter

## 性能

### umi/dynamic

动态加载组件。

#### dynamic(resolve)
Expand Down Expand Up @@ -149,6 +144,8 @@ dynamic(async function() {}, {
})
```

## 构建

### umi/babel
让用户可基于 umi 的 babel 配置进行扩展。

让用户可基于 umi 的 babel 配置进行扩展。
6 changes: 0 additions & 6 deletions docs/cli.md

This file was deleted.

130 changes: 0 additions & 130 deletions docs/config-umi.md

This file was deleted.

Loading

0 comments on commit 057ffd4

Please sign in to comment.