Skip to content

Commit

Permalink
test: egg-view-nunjucks change views -> view (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
atian25 authored and fengmk2 committed Sep 1, 2016
1 parent a955e1f commit c888d79
Show file tree
Hide file tree
Showing 24 changed files with 8 additions and 8 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion benchmarks/simple_view/koa.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ while (n--) {
const options = {
noCache: false,
};
const viewPaths = path.join(__dirname, 'app/views');
const viewPaths = path.join(__dirname, 'app/view');
const engine = new nunjucks.Environment(new nunjucks.FileSystemLoader(viewPaths, options), options);

function render(name, locals) {
Expand Down
4 changes: 2 additions & 2 deletions docs/web.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Let's use an app called `helloweb` as an example. Its file structure may look li
│ │ └── ...
│ ├── middleware (optional)
│ │ └── response_time.js
│ └── view (optional, base view plugin rule, we suggest to use views)
│ └── view (optional, base view plugin rule, we suggest to use view)
│ ├── layout.html
│ └── home.html
├── config
Expand Down Expand Up @@ -254,7 +254,7 @@ Each service is defined in `app/service/*.js` will be injected into `ctx.service
└── user.js ==> ctx.service.user
```
#### `app/views`
#### `app/view`
This directory is used to store template files in scripts used in rendering client side view templates. For more detail, please see `template rendering guide`
Expand Down
6 changes: 3 additions & 3 deletions docs/web.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
│ │ └── ...
│ ├── middleware (optional)
│ │ └── response_time.js
│ └── view (optional, base view plugin rule, we suggest to use views)
│ └── view (optional, base view plugin rule, we suggest to use view)
│ ├── layout.html
│ └── home.html
├── config
Expand Down Expand Up @@ -95,7 +95,7 @@
### `app` directory
`app` 目录是一个应用业务逻辑代码存放的地方。
它是整个应用的核心目录,包含 `router.js``controller``views``middleware` 等常用功能目录。
它是整个应用的核心目录,包含 `router.js``controller``view``middleware` 等常用功能目录。
同时还包含可选的 `service``proxy` 等服务调用相关功能代码目录。
#### `app/router.js`
Expand Down Expand Up @@ -251,7 +251,7 @@ module.exports = UserService;
└── user.js ==> ctx.service.user
```
#### `app/views`
#### `app/view`
存放模板文件和只在客户端使用的脚本目录文件。 此规范有 view 插件约定。具体规范参见下文的 `模板渲染约定`
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/view_nunjucks/config/config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
exports.keys = 'my secret keys';

exports.view = {
// dir: 'path/to/template/dir', // default to `{app_root}/app/views`
// dir: 'path/to/template/dir', // default to `{app_root}/app/view`
cache: true, // local env is false
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"egg-ci": "1",
"egg-mock": "^0.0.4",
"egg-plugin-puml": "1",
"egg-view-nunjucks": "^0.2.0",
"egg-view-nunjucks": "^0.3.0",
"eslint": "^3.0.0",
"eslint-config-egg": "^3.1.0",
"estraverse": "^4.1.1",
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit c888d79

Please sign in to comment.