Skip to content

Commit

Permalink
doc: add intro for 404 page
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Feb 27, 2018
1 parent 3876a24 commit 1c54aa9
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 4 deletions.
16 changes: 16 additions & 0 deletions docs/add-404-page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
id: add-404-page
title: 添加 404 页面
---

umi 中约定 pages 目录下的 404.js 为 404 页面,这个文件需要返回 React 组件。比如:

```js
export default () => {
return (
<div>404 page</div>
);
};
```

开发模式下,umi 会添加一个默认的 404 页面,但你仍然可通过精确地访问 `/404` 来验证 404 页面。
5 changes: 3 additions & 2 deletions docs/app-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ title: 目录结构
├── .umi/ // dev 临时目录,需添加到 .gitignore
├── .umi-production/ // build 临时目录,会自动删除
├── document.ejs // HTML 模板
├── list.js // 页面 1
└── index.js // 页面 2
├── 404.js // 404 页面
├── page1.js // 页面 1,任意命名
└── page2.js // 页面 2,任意命名
├── global.css // 约定的全局样式文件,自动引入,也可以用 global.less
├── _routes.json // 路由配置,和文件路由二选一
├── test/ // 测试用例放这里
Expand Down
1 change: 1 addition & 0 deletions website/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"next": "Next",
"previous": "Previous",
"tagline": "Blazing-fast next.js-like framework for React apps.",
"add-404-page": "添加 404 页面",
"api": "API",
"app-structure": "目录结构",
"cli": "命令行",
Expand Down
1 change: 1 addition & 0 deletions website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
],
"Guides": [
"router",
"add-404-page",
"html-tpl",
"load-on-demand",
"pwa",
Expand Down
16 changes: 16 additions & 0 deletions website/translated_docs/zh-Hans/add-404-page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
id: add-404-page
title: 添加 404 页面
---

umi 中约定 pages 目录下的 404.js 为 404 页面,这个文件需要返回 React 组件。比如:

```js
export default () => {
return (
<div>404 page</div>
);
};
```

开发模式下,umi 会添加一个默认的 404 页面,但你仍然可通过精确地访问 `/404` 来验证 404 页面。
5 changes: 3 additions & 2 deletions website/translated_docs/zh-Hans/app-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ title: 目录结构
├── .umi/ // dev 临时目录,需添加到 .gitignore
├── .umi-production/ // build 临时目录,会自动删除
├── document.ejs // HTML 模板
├── list.js // 页面 1
└── index.js // 页面 2
├── 404.js // 404 页面
├── page1.js // 页面 1,任意命名
└── page2.js // 页面 2,任意命名
├── global.css // 约定的全局样式文件,自动引入,也可以用 global.less
├── _routes.json // 路由配置,和文件路由二选一
├── test/ // 测试用例放这里
Expand Down

0 comments on commit 1c54aa9

Please sign in to comment.